Please use R-studio code to answer the question!
Create a variable called 'pizza' whose value corresponds to the price of pizza you’ve eaten in the last week. Or something equally same. Now create another varible 'tax' whose value corresponds to 15% of the price of pizza. Now add these two values and store your result as 'myCost'. I assume the utility you enjoyed was 50 utils. So create a third variable 'myUtility' whose value is 50. Use logical operations to check whether your myUtility is equal to your myCost or not.
Below is the R code to create the variable and check the whether myUtility is equal to myCost or not.
# Create variable "pizza"
> pizza <- 350
# Create variable "tax"
> tax <- pizza*0.15
> tax
[1] 52.5
# Add "pizza" and tax and save into myCost
> myCost = pizza+tax
> myCost
[1] 402.5
> myUtility <- 50
# Check whether both are equal or not using logical
operator
> myCost < myUtility
[1] FALSE
> myCost > myUtility
[1] TRUE
Get Answers For Free
Most questions answered within 1 hours.