Question: I already completed the code but don't know how to solve the Extra credit. C ++ ( I need only extra credit). total. The program
I already completed the code but don't know how to solve the Extra credit. C ++ ( I need only extra credit).



total. The program should indicate the amount of the egg discount only if there is a discount. Toilet Paper: 1-5 rolls: $1.99 each 6-10 rolls: $1.49 each 11 or more: $0.99 each This process of allowing the customer to select an item and your program displaying the subtotal should continue until the customer selects to exit when prompted for the item hefshe wants to purchase. Your program should then display,r the total amount due and the total amount of the discount (if there is any). There is a major snowstorm coming and your store is selling those essential items needed by everyone. Customers will have the option to buy Milk, Bread, Eggs and Toilet Paper from your store. You need to create a program to allow the customers to buy each of these items and then display the total due at the end. Follow the sample output screen shots in order to determine how your program should run and then display the data. Place your name as the owner of the store (Snow 'R' Us). Using a menu, your program should ask the customer what item he/she wants to purchase. If the customer indicates an item that your store does not sell, an error message should display telling the customer that you do not sell that item. If the customer indicates a valid item, ask the customer how many of the item he/she wants to buy. Make sure that the input is a positive number greater than zero before proceeding. If the value is not positive, make sure the customer has the ability to reenter the value until they enter in a valid value. Calculate and display the subtotal to the customer. The prices are as follows: Milk is $6.25 per gallon. You can only buy whole number gallons. Bread is $2.25 per loaf, unless the customer enters the coupon code "breadI". If the customer enters the correct code, bread is $1.50 per loaf. The only valid entries for the coupon code is "bread!" or "NONE". Any other entry should be flagged as invalid and the customer should be allowed to reenter the coupon code. Eggs are $2.00 for each half dozen or $3.50 for each full dozen. If the customer buys at least two gallons of milk, they get eggs for half price. This egg discount is only applied at the very end when calculating the finalEXTRA CREDIT: Keep track of the number of rolls of toilet paper. Calculate the total cost of the toilet paper based on the total number of rolls purchased accumulated over time. For example: If the customer buys 5 rolls of toilet paper, the cost is (5 * $1.99) = $9.95 The customer then goes in and buys another 5 rolls. In the base program, the subtotal cost of the toilet paper would be (5 * $1.99) + (5 * $1.99) = $19.90. In the extra credit version of the program, the subtotal cost of the toilet paper should now be (10 * $1.49) = $14.90. This is worth 5 extra points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
