Question: Project 2, Program Design 1. (60 points) A u-pick farm allows customers to pick four different berry products in their farm. The prices are: 1.

 Project 2, Program Design 1. (60 points) A u-pick farm allows

Project 2, Program Design 1. (60 points) A u-pick farm allows customers to pick four different berry products in their farm. The prices are: 1. strawberry - $1.99/1b, 2. blueberry - $4.39/1b, 3. blackberry $3.69/1b, 4. raspberry - $5.99/1b. Write a program that allows the user to select products, input the weights of each product, and calculate the total amount due. The farm only accepts cash. Your program will take input of the cash received and calculate the change. A sample input/output: Please select a product: 1. strawberry - $1.99/lb, 2. blueberry - $4.39/lb, 3. blackberry $3.69/lb, 4. raspberry - $5.99/lb. Enter 0 to stop selection. Enter product selection: 1 Enter product weight (lb): 4.8 Enter product selection: 3 Enter product weight (lb): 2 Enter product selection: 7 Invalid selection, select from 1 to 5, enter 0 to stop selection Enter product selection: 4 Enter product weight (lb): 1.6 Enter product selection: 0 Amount due ($): 15.96 Enter cash received ($): 20 Your change is $4.04 1) Name your program berries.c 2) If the user selects a number out of the range (1 through 4), display a message and allows the user to select again. When user enters 0, the program should exit from the loop for selection. 3) Use a switch statement to compute the amount due according to the product selection

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!