Question

Please use R-studio code to answer the question! Create a variable called 'pizza' whose value corresponds...

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.

Homework Answers

Answer #1

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

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
**[70 pts]** You will be writing a (rather primitive) online store simulator. It will have these...
**[70 pts]** You will be writing a (rather primitive) online store simulator. It will have these classes: Product, Customer, and Store. All data members of each class should be marked as **private** (a leading underscore in the name). Since they're private, if you need to access them from outside the class, you should do so via get or set methods. Any get or set methods should be named per the usual convention ("get_" or "set_" followed by the name of...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...