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
let us create a variable for a row vector a = [1, 4, 1, 3, 2,...
let us create a variable for a row vector a = [1, 4, 1, 3, 2, 5, 0] and calculate the mean value of its elements using the Matlab function ‘mean’ and store this value in variable aMean. Fig. 1 gives the Matlab code to do this. a = [1, 4, 1, 3, 2, 5, 0]; aMean = mean(a); Figure 1: Matlab code – row vector and mean of its elements. Let us now construct a row vector b that...
Use Rstudio to create a script by following the instruction below. I've created the first question...
Use Rstudio to create a script by following the instruction below. I've created the first question code but I can not continue it further. Thank you. ## Write a function called `make_introduction` that takes in two arguments: name, and age. ## This function should return a string value that says something like "Hello, my name is {name}, and I'm ## {age} years old". make_introduction <- function(name, age){ print(paste("Hello, my name is", name, "and I'm", age, "years old")) } ## Create...
**[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...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...