Question: For Java Modify the coffee shop program Add code that allows multiple customers This will require a loop Also, each customer can buy regular coffee,

For JavaFor Java Modify the coffee shop program Add code that allows multiple

customers This will require a loop Also, each customer can buy regular

Modify the coffee shop program Add code that allows multiple customers This will require a loop Also, each customer can buy regular coffee, latte, or espresso Again, customers can buy multiple cups However, all cups must be the same type You should have different prices for the different types of drinks Your submission should consist of a test class as well as the coffee shop class Create methods as appropriate. Use good design principles: Ask the customer the various questions Avoid excessive questions and options Make sure you follow basic coding principles Comment each method and other parts of the code, as you think it's appropriate public class Coffee Shop { double total; // A variable to hold the amount the customer owes /** A method to calculate a customer's bill. The amount owed is stored in the variable total. @param numCups The number of cups of coffee the customer ordered +/ void calcBill (int numCups) final double cupCost = 2.35 The cost of a single cup of coffee final double taxRate = 0.09, 11 The current tax rate double subtotal, salesTax; 1/ Calculate the subtotal subtotal = cupCost numCups; 11 Calculate the sales tax salesTax = taxRace subtotal, // Calculate the full price total = subtotal + salesTax, 3 /** Return the amount owed by the customer @returns The amount the customer owes double getBill) return total; 3 }

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!