Question: I have been trying get the right code with C + + style but its wrong and not compiling right. The local flying - disc

I have been trying get the right code with C++ style but its wrong and not compiling right.
The local flying-disc shop sells premium disc-golf and ultimate (Frisbee) discs. The disc-golf discs retail for $15.88 and the ultimate discs retail for $12.96 each. Sample Output (user input is in yellow)
Welcome to the Flying-Disc Shop!
Enter 'u' for ultimate discs and 'g' for disc golf: g
Enter the number of Disc-Golf Disc(s): 3
Receipt
Disc Type: Disc-Golf Disc
Quantity: 3
Price per Disc: $ 15.88
Total Savings: $ -0.00
Total: $ 47.64
Sample Output (user input is in yellow)
Welcome to the Flying-Disc Shop!
Enter 'u' for ultimate discs and 'g' for disc golf: U
Enter the number of Ultimate Disc(s): 150
-------------Receipt
Disc Type: Ultimate Disc
Quantity: 150
Price per Disc: $ 8.81
Total Savings: $ -622.08
Total: $ 1321.92
Sample Output (user input is in yellow)
Welcome to the Flying-Disc Shop!
Enter 'u' for ultimate discs and 'g' for disc golf: g
Enter the number of Disc-Golf Disc(s): 0
0 is an invalid number of discs.
Sample Output (user input is in yellow)
Welcome to the Flying-Disc Shop!
Enter 'u' for ultimate discs and 'g' for disc golf: r
Invalid disc type.
Submit only your file named FlyingDiscs.cpp.
Quantity discounts are given as follows:
Number of Discs Discount
5-9,8%
10-19,16%
20-29,24%
30or more 32%
Write a program that asks the cashier if the customer wishes to purchase disc-golf or ultimate discs. The cashier enters a 'u' or 'U' for ultimate and 'g' or 'G' for disc
golf; all other input-output the error message, "Invalid disc type." exit the program. (Use a switch statement to check the user's input and use return 0; in the
switch statement to end the program.). If the input was valid, the program should then prompts the user for the number of discs. If the number is positive, the
program displays the disc type, quantity, price per disc (after any discount), the total savings, and total price (with exactly 2 decimal places). Otherwise, the program
displays the error message, " X is an invalid number of discs" (where X is the user-inputted number).
In your implementation, avoid duplicating your code; arrange the program logic so that no statements are repeated. (Hint: a single string variable is useful to hold
either "Ultimate Disc" or "Disc-Golf Disc") Also, define and use constants for the retail prices (i.e., DISC_GOLF_RETAIL, ULTIMATE_RETAIL). You may use
additional constants if you choose.
Sample Output (user input is in yellow)
Welcome to the Flying-Disc Shop!
Enter 'u' for ultimate discs and 'g' for disc golf: g
Enter the number of Disc-Golf Disc(s): 3
------------Receipt
Disc Type: Disc-Golf Disc
Quantity: 3
Price per Disc: $15.88
Total Savings: $ -0.00
Total: $ 47.64
Sample Output (user input is in yellow)
Welcome to the Flying-Disc Shop!
Enter 'u' for ultimate discs and 'g' for disc golf: U
Enter the number of Ultimate Disc(s): 150
------------Receipt-
Disc Type: Ultimate Disc
Quantity: 150
Price per Disc: $ 8.81
Total Savings: $ -622.08
Total: $ 1321.92
I have been trying get the right code with C + +

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 Programming Questions!