Question: R language IceCreamPrice 0 # Add your code here }

 R language IceCreamPrice <- function(numScoops, wantChocolate, wantCaramel, wantSprinkles) { # Returns the total price of an ice cream order with 'numScoops' number of # scoops. Each scoop costs $2.50. # 'wantChocolate', 'wantCaramel', and 'wantSprinkles' indicate whether or not # the customer wants certain toppings. # # Each topping is an extra $0.50. However, a customer can not order chocolate and # caramel together. If they do this, a price of -1 should be returned, # indicating a bad order. # # The maximum number of scoops for an order is 3. If 'numScoops' is more than # 3, a price of -1 should be returned. # Precondition: 'numScoops' > 0 # Add your code here } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!