Question: Part 2: Create GenCheeseShop.java The machine should dispense ANY types of cheese, in half-pound packages. Your program will STILLO the following A. List all the

 Part 2: Create GenCheeseShop.java The machine should dispense ANY types of
cheese, in half-pound packages. Your program will STILLO the following A. List
all the cheese types available and the prices B. Asks the user
how many pounds of each type of cheese to purchase in 0.5

Part 2: Create GenCheeseShop.java The machine should dispense ANY types of cheese, in half-pound packages. Your program will STILLO the following A. List all the cheese types available and the prices B. Asks the user how many pounds of each type of cheese to purchase in 0.5 lb increments. C. Calculate Original Sub Total (price amount of each cheese added together) D. Calculate discounts based on how many pounds for Humboldt Fog and Red Hawk cheeses the user entered, as well as the total purchase amount o See Discount Calculation below for details E. Ask the user if they would like to see a list of what they purchased If yes, a list comes up showing how much of each type of cheese they bought and the cost of cach cheese. Display only the cheese they actually bought o If no items are purchased, then display a message stating the same (see Sample Run 4) If the user answers no, then no itemized information is displayed F. Display Original Sub Total, Specials and New Sub Total , Additional Discount and Final Total as shown in the Sample Runs below (see Discount Calculation below to see how these are calculated). Note, you must use printf to format your output (cf. Section 9.2 in zy Books). For instance, you will use the following print statement to print costs of individual items in your itemized list System.out.printf("%.2f lb of Xs @ sx.2f = $%.2f ", amounts[1], names[1], prices[i], prices[i]'amounts[i]); Discount Calculation For this lab, there are two types of discounts. As before, the first discount is based on the amounts of Humbolde Fog and Red Hawk bought, with the following specials offered: Humboldt Forg: Buy 1 package yet I package free Red Hawk: Buy 2 packages get 1 package free See the previous lab assignment for details on how to calculate these discounts. Assuming the user buys 4.5 lb of Humbolt Fog and 4.5 lb of Rod Hawk and no Teleme, the itemized list and discount calculation for this order will appear as follows: Display the itemized list? (1 for yes) 1 4.5 lb of Humboldt fog $25.00 - $112.50 4.5 lb of Red Hawk @ $48.50 - $182.25 Original Sub Total: $294.75 Specials... Humboldt Fog (Buy 1 Get 1 Free):-sse.ee Red Hawk (Buy 2 Get 1 Free): -$60.75 New Sub Total: Here the values are as follows: Original Sub Total is the price amount of each cheese added together $50 discount for Humboldt Fog corresponds to the 2 Tb (or 4 pkgs) in the order that were free $60.75 discount for Red Hawk corresponds to the 1.5 lb (or 3 pkgs) in the order that were free New Sub Total = Original Sub Total - (Humboldt Fog discount +Red Hawk discount) After obtaining the New Sub Total, the Additional Discount is calculated as follows: A 10% discount if New Sub Total is over $150 An additional 15% discount if New Sub Total is over $250 And finally, the Final Total is obtained by subtracting the Additional Discount from the New Sub Total, $184.00 Sample Runs (user input shown in green, with each run separated by a dashed line): -SAMPLE RUN 1 Enter the number of cheeses for shop setup: We selle kinds of cheese, in 0.5 lb packages. se.ee Original Sub Total: Specials... None New Sub Total: Additional ex Discount: Final Total: - $0.00 $e.ee -$0. $0.00 -SAMPLE RUN 2 Enter the number of cheeses for shop setup: 1 We sell 1 kinds of cheese, in 0.5 lb packages. Humboldt Fog: $25.0 per pound Enter the amount of Humboldt Fog in 1b: 1 Display the itemized list? (1 for yes) 1 1. lb of Humboldt Fog @ $25.00 - $25.00 Original Sub Total: $25.00 Specials... Humboldt Fog (Buy 1 Get 1 Free): $12.se New Sub Total: $12.50 Additional ex Discount: -$0.0 Final Total: $12.50 -SAMPLE RUN Enter the number of cheeses for shop setup: 2 We sell 2 kinds of cheese, in 0.5 lb packages. Humboldt Fog: $25.e per pound Red Hawk : $40.5 per pound Enter the amount of Humboldt Fog in lb: 4.5 Enter the amount of Red Hawk in lb: 4.5 Display the itemized list? (1 for yes) 1 4.5 lb of Humboldt Fog @ $25.00 - $112.50 4.5 lb of Red Hawk @ $40.50 - $182.25 Original Sub Total: $294.75 Specials... Humboldt Fog (Buy 1 Get 1 Free): -55e.ee Red Hawk (Buy 2 Get 1 Free): - $69.75 New Sub Total: $184.ee Additional 10% Discount: -$18.40 Final Total: $165.60 -SAMPLE RUN 4 Enter the number of cheeses for shop setup: 3 We sell 3 kinds of cheese, in 8.5 lb packages. Humboldt Fog: $25.0 per pound Red Hawk: $40.5 per pound Teleme: $17.25 per pound Enter the amount of Humboldt Fog in lb: Enter the amount of Red Hawk in lb: Enter the amount of Telene in lb: Display the itemized list? (1 for yes) 1 No items were purchased. Original Sub Total: se.ee Specials... None - $0.00 New Sub Total: se.ee Additional ex Discount: -se.e Final Total: se.ee -SAMPLE RUNS Enter the number of cheeses for shop setup: 4 We sell 4 kinds of cheese, in 8.5 lb packages. Humboldt Fog: $25.0 per pound Red Hawk: $40.5 per pound Teleme: $17.25 per pound Cheese Type D: $9.15 per pound Enter the anount of Humboldt Fog in lb: 2.3 Invalid input. Enter a value that's multiple of 0.5: 25 Enter the amount of Red Hawk in 1b: 3.5 Enter the amount of Telene in lb: Enter the amount of Cheese Type D in lb: 17 Invalid input. Enter a value that's multiple of 0.5: -1.5 Invalid input. Enter a value > 0: 1.5 Display the itemized list? (1 for yes) 1 2.5 lb of Humboldt Fog @ $25.ee - $62.se 3.5 lb of Red Hawk $40.5e = $141.75 1.5 lb of Cheese Type D @ $9.15 - $13.73 Original Sub Total: $217.98 Specials... Humboldt Fog (Buy 1 Get 1 Free): $25.ee Red Hawk (Buy 2 Get 1 Free): - $40.50 New Sub Total: $152.48 Additional 10% Discount: -$15.25 Final Total: $137.23 SAMPLE RUN 6 Enter the number of cheeses for shop setup: 10 We sell 10 kinds of cheese, in 0.5 lb packages. Humboldt Fog: $25.0 per pound Red Hawk: $40.5 per pound Teleme: $17.25 per pound Cheese Type D: $9.15 per pound Cheese Type E: $2.5 per pound Cheese Type F: $8.74 per pound Cheese Type G: $9.88 per pound Cheese Type H: $2.91 per pound Cheese Type 1: $6.66 per pound Cheese Type 3: $0.36 per pound Enter the amount of Humboldt Fog in 1b: 1 Enter the amount of Red Hawk in lb: 2 Enter the amount of Telene in lb: 3 Enter the amount of Cheese Type D in 1b: Enter the amount of Cheese Type E in lb: a Enter the amount of Cheese Type F in lb: 8.3 Invalid input. Enter a value that's multiple of 8.5: 4 Enter the amount of Cheese Type G in lb: 5 Enter the amount of Cheese Type H in lb: Enter the amount of Cheese Type I in lb: 8 Enter the amount of Cheese Type ) in lb: 6 Display the itemized list? (1 for yes) Original Sub Total: $244.27 Specials... Humboldt Fog (Buy 1 Get 1 Free): -$12.50 Red Hawk (Buy 2 Get 1 Free): - $20.25 New Sub Total: $211.52 Additional 10% Discount: -$21.15 Final Total: $190.37 - SAMPLE RUN 7 Enter the number of cheeses for shop setup: 8 We sell 8 kinds of cheese, in e.5 lb packages. Humboldt Fog: $25.0 per pound Red Hawk : $40.5 per pound Teleme: $17.25 per pound Cheese Type D: $9.15 per pound Cheese Type E: $2.5 per pound Cheese Type F: $8.74 per pound Cheese Type G: $9.88 per pound Cheese Type H: $2.91 per pound Enter the amount of Humboldt Fog in lb: 4 Enter the amount of Red Hawk in lb: 5 Enter the amount of Teleme in lb: B Enter the amount of Cheese Type D in lb: @ Enter the amount of Cheese Type E in lb: 8 Enter the amount of Cheese Type F in lb: 3.7 Invalid input. Enter a value that's multiple of 0.5: 3.2 Invalid input. Enter a value that's multiple of 8.5: 3.5 Enter the amount of Cheese Type G in lb: 5.5 Enter the amount of Cheese Type H in 1b: Display the itemized list? (1 for yes) 1 4.0 lb of Humboldt Fog @ $25.00 - $1ee.ee 5.0 lb of Red Hawk @ $48.50 - $282.50 3.5 lb of Cheese Type F @ $8.74 = $3.59 5.5 lb of Cheese Type G @ $9.88 = $54.34 20 Original Sub Total: $387.43 Specials... Humboldt Fog (Buy 1 Get 1 Free): -$50.ee Red Hawk (Buy 2 Get 1 Free): - $68.75 New Sub Total: $276.68 Additional 25% Discount: - $69.17 Final Total: $207.51 Part 2: Create GenCheeseShop.java The machine should dispense ANY types of cheese, in half-pound packages. Your program will STILLO the following A. List all the cheese types available and the prices B. Asks the user how many pounds of each type of cheese to purchase in 0.5 lb increments. C. Calculate Original Sub Total (price amount of each cheese added together) D. Calculate discounts based on how many pounds for Humboldt Fog and Red Hawk cheeses the user entered, as well as the total purchase amount o See Discount Calculation below for details E. Ask the user if they would like to see a list of what they purchased If yes, a list comes up showing how much of each type of cheese they bought and the cost of cach cheese. Display only the cheese they actually bought o If no items are purchased, then display a message stating the same (see Sample Run 4) If the user answers no, then no itemized information is displayed F. Display Original Sub Total, Specials and New Sub Total , Additional Discount and Final Total as shown in the Sample Runs below (see Discount Calculation below to see how these are calculated). Note, you must use printf to format your output (cf. Section 9.2 in zy Books). For instance, you will use the following print statement to print costs of individual items in your itemized list System.out.printf("%.2f lb of Xs @ sx.2f = $%.2f ", amounts[1], names[1], prices[i], prices[i]'amounts[i]); Discount Calculation For this lab, there are two types of discounts. As before, the first discount is based on the amounts of Humbolde Fog and Red Hawk bought, with the following specials offered: Humboldt Forg: Buy 1 package yet I package free Red Hawk: Buy 2 packages get 1 package free See the previous lab assignment for details on how to calculate these discounts. Assuming the user buys 4.5 lb of Humbolt Fog and 4.5 lb of Rod Hawk and no Teleme, the itemized list and discount calculation for this order will appear as follows: Display the itemized list? (1 for yes) 1 4.5 lb of Humboldt fog $25.00 - $112.50 4.5 lb of Red Hawk @ $48.50 - $182.25 Original Sub Total: $294.75 Specials... Humboldt Fog (Buy 1 Get 1 Free):-sse.ee Red Hawk (Buy 2 Get 1 Free): -$60.75 New Sub Total: Here the values are as follows: Original Sub Total is the price amount of each cheese added together $50 discount for Humboldt Fog corresponds to the 2 Tb (or 4 pkgs) in the order that were free $60.75 discount for Red Hawk corresponds to the 1.5 lb (or 3 pkgs) in the order that were free New Sub Total = Original Sub Total - (Humboldt Fog discount +Red Hawk discount) After obtaining the New Sub Total, the Additional Discount is calculated as follows: A 10% discount if New Sub Total is over $150 An additional 15% discount if New Sub Total is over $250 And finally, the Final Total is obtained by subtracting the Additional Discount from the New Sub Total, $184.00 Sample Runs (user input shown in green, with each run separated by a dashed line): -SAMPLE RUN 1 Enter the number of cheeses for shop setup: We selle kinds of cheese, in 0.5 lb packages. se.ee Original Sub Total: Specials... None New Sub Total: Additional ex Discount: Final Total: - $0.00 $e.ee -$0. $0.00 -SAMPLE RUN 2 Enter the number of cheeses for shop setup: 1 We sell 1 kinds of cheese, in 0.5 lb packages. Humboldt Fog: $25.0 per pound Enter the amount of Humboldt Fog in 1b: 1 Display the itemized list? (1 for yes) 1 1. lb of Humboldt Fog @ $25.00 - $25.00 Original Sub Total: $25.00 Specials... Humboldt Fog (Buy 1 Get 1 Free): $12.se New Sub Total: $12.50 Additional ex Discount: -$0.0 Final Total: $12.50 -SAMPLE RUN Enter the number of cheeses for shop setup: 2 We sell 2 kinds of cheese, in 0.5 lb packages. Humboldt Fog: $25.e per pound Red Hawk : $40.5 per pound Enter the amount of Humboldt Fog in lb: 4.5 Enter the amount of Red Hawk in lb: 4.5 Display the itemized list? (1 for yes) 1 4.5 lb of Humboldt Fog @ $25.00 - $112.50 4.5 lb of Red Hawk @ $40.50 - $182.25 Original Sub Total: $294.75 Specials... Humboldt Fog (Buy 1 Get 1 Free): -55e.ee Red Hawk (Buy 2 Get 1 Free): - $69.75 New Sub Total: $184.ee Additional 10% Discount: -$18.40 Final Total: $165.60 -SAMPLE RUN 4 Enter the number of cheeses for shop setup: 3 We sell 3 kinds of cheese, in 8.5 lb packages. Humboldt Fog: $25.0 per pound Red Hawk: $40.5 per pound Teleme: $17.25 per pound Enter the amount of Humboldt Fog in lb: Enter the amount of Red Hawk in lb: Enter the amount of Telene in lb: Display the itemized list? (1 for yes) 1 No items were purchased. Original Sub Total: se.ee Specials... None - $0.00 New Sub Total: se.ee Additional ex Discount: -se.e Final Total: se.ee -SAMPLE RUNS Enter the number of cheeses for shop setup: 4 We sell 4 kinds of cheese, in 8.5 lb packages. Humboldt Fog: $25.0 per pound Red Hawk: $40.5 per pound Teleme: $17.25 per pound Cheese Type D: $9.15 per pound Enter the anount of Humboldt Fog in lb: 2.3 Invalid input. Enter a value that's multiple of 0.5: 25 Enter the amount of Red Hawk in 1b: 3.5 Enter the amount of Telene in lb: Enter the amount of Cheese Type D in lb: 17 Invalid input. Enter a value that's multiple of 0.5: -1.5 Invalid input. Enter a value > 0: 1.5 Display the itemized list? (1 for yes) 1 2.5 lb of Humboldt Fog @ $25.ee - $62.se 3.5 lb of Red Hawk $40.5e = $141.75 1.5 lb of Cheese Type D @ $9.15 - $13.73 Original Sub Total: $217.98 Specials... Humboldt Fog (Buy 1 Get 1 Free): $25.ee Red Hawk (Buy 2 Get 1 Free): - $40.50 New Sub Total: $152.48 Additional 10% Discount: -$15.25 Final Total: $137.23 SAMPLE RUN 6 Enter the number of cheeses for shop setup: 10 We sell 10 kinds of cheese, in 0.5 lb packages. Humboldt Fog: $25.0 per pound Red Hawk: $40.5 per pound Teleme: $17.25 per pound Cheese Type D: $9.15 per pound Cheese Type E: $2.5 per pound Cheese Type F: $8.74 per pound Cheese Type G: $9.88 per pound Cheese Type H: $2.91 per pound Cheese Type 1: $6.66 per pound Cheese Type 3: $0.36 per pound Enter the amount of Humboldt Fog in 1b: 1 Enter the amount of Red Hawk in lb: 2 Enter the amount of Telene in lb: 3 Enter the amount of Cheese Type D in 1b: Enter the amount of Cheese Type E in lb: a Enter the amount of Cheese Type F in lb: 8.3 Invalid input. Enter a value that's multiple of 8.5: 4 Enter the amount of Cheese Type G in lb: 5 Enter the amount of Cheese Type H in lb: Enter the amount of Cheese Type I in lb: 8 Enter the amount of Cheese Type ) in lb: 6 Display the itemized list? (1 for yes) Original Sub Total: $244.27 Specials... Humboldt Fog (Buy 1 Get 1 Free): -$12.50 Red Hawk (Buy 2 Get 1 Free): - $20.25 New Sub Total: $211.52 Additional 10% Discount: -$21.15 Final Total: $190.37 - SAMPLE RUN 7 Enter the number of cheeses for shop setup: 8 We sell 8 kinds of cheese, in e.5 lb packages. Humboldt Fog: $25.0 per pound Red Hawk : $40.5 per pound Teleme: $17.25 per pound Cheese Type D: $9.15 per pound Cheese Type E: $2.5 per pound Cheese Type F: $8.74 per pound Cheese Type G: $9.88 per pound Cheese Type H: $2.91 per pound Enter the amount of Humboldt Fog in lb: 4 Enter the amount of Red Hawk in lb: 5 Enter the amount of Teleme in lb: B Enter the amount of Cheese Type D in lb: @ Enter the amount of Cheese Type E in lb: 8 Enter the amount of Cheese Type F in lb: 3.7 Invalid input. Enter a value that's multiple of 0.5: 3.2 Invalid input. Enter a value that's multiple of 8.5: 3.5 Enter the amount of Cheese Type G in lb: 5.5 Enter the amount of Cheese Type H in 1b: Display the itemized list? (1 for yes) 1 4.0 lb of Humboldt Fog @ $25.00 - $1ee.ee 5.0 lb of Red Hawk @ $48.50 - $282.50 3.5 lb of Cheese Type F @ $8.74 = $3.59 5.5 lb of Cheese Type G @ $9.88 = $54.34 20 Original Sub Total: $387.43 Specials... Humboldt Fog (Buy 1 Get 1 Free): -$50.ee Red Hawk (Buy 2 Get 1 Free): - $68.75 New Sub Total: $276.68 Additional 25% Discount: - $69.17 Final Total: $207.51

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!