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

C programming
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 O 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 4, enter 0 to stop selection Enter product selection: 4 Enter product weight (lb): 1.6 Enter product selection: 0 Amount due ($): 26.52 Enter cash received ($): 30 Your change is $3.48 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
Get step-by-step solutions from verified subject matter experts
