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 flyingdisc shop sells premium discgolf and ultimate Frisbee discs. The discgolf discs retail for $ and the ultimate discs retail for $ each. Sample Output user input is in yellow
Welcome to the FlyingDisc Shop!
Enter u for ultimate discs and g for disc golf:
Enter the number of DiscGolf Discs:
Receipt
Disc Type: DiscGolf Disc
Quantity:
Price per Disc: $
Total Savings: $
Total: $
Sample Output user input is in yellow
Welcome to the FlyingDisc Shop!
Enter u for ultimate discs and g for disc golf: U
Enter the number of Ultimate Discs:
Receipt
Disc Type: Ultimate Disc
Quantity:
Price per Disc: $
Total Savings: $
Total: $
Sample Output user input is in yellow
Welcome to the FlyingDisc Shop!
Enter u for ultimate discs and g for disc golf: g
Enter the number of DiscGolf Discs:
is an invalid number of discs.
Sample Output user input is in yellow
Welcome to the FlyingDisc Shop!
Enter u for ultimate discs and g for disc golf:
Invalid disc type.
Submit only your file named FlyingDiscs.cpp
Quantity discounts are given as follows:
Number Discs Discount
more
Write a program that asks the cashier if the customer wishes to purchase discgolf or ultimate discs. The cashier enters a u or U for ultimate and g or G for disc
golf; all other inputoutput the error message, "Invalid disc type." exit the program. Use a switch statement to check the user's input and use return ; 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 decimal places Otherwise, the program
displays the error message, X is an invalid number of discs" where X is the userinputted 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 "DiscGolf Disc" Also, define and use constants for the retail prices ie DISCGOLFRETAIL, ULTIMATERETAIL You may use
additional constants if you choose.
Sample Output user input is in yellow
Welcome to the FlyingDisc Shop!
Enter u for ultimate discs and g for disc golf: g
Enter the number of DiscGolf Discs:
Receipt
Disc Type: DiscGolf Disc
Quantity:
Price per Disc: $
Total Savings: $
Total: $
Sample Output user input is in yellow
Welcome to the FlyingDisc Shop!
Enter u for ultimate discs and g for disc golf: U
Enter the number of Ultimate Discs:
Receipt
Disc Type: Ultimate Disc
Quantity:
Price per Disc: $
Total Savings: $
Total: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
