Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A restaurant has three categories on their menu: beverage, entree and dessert. F

ID: 3529736 • Letter: A

Question

A restaurant has three categories on their menu: beverage, entree and dessert. For the beverage, the customer can choose coke, sprite, water (bottled), water (tap) <-- free. For the entree, the customer can choose hamburger (with or without cheese), veggie burger (with or without cheese) or tuna salad sandwich. For the dessert, the customer can choose vanilla ice cream or cheese cake. Assume there is only one order and one meal per customer. Display the order summary and the total for the order including sales tax. Each beverage is 2 dollars, except for tap water, which is free.

Explanation / Answer

Hey This is the exact program for your requirment..Check it out..Run it.And see how it works.Comment in case any problem

Code Goes Here :

Bevrage Class

public class Bevrage {


private String name;

private double price;

public Bevrage(String name, double price) {

super();

this.name = name;

this.price = price;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public double getPrice() {

return price;

}

public void setPrice(double price) {

this.price = price;

}

public String toString()

{

return "Name : "+name+" Price : "+price+" ";

}

}

Desert Class

public class Desert {


private String name;

private double price;

public Desert() {

super();

}

public Desert(String name, double price) {

super();

this.name = name;

this.price = price;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public double getPrice() {

return price;

}

public void setPrice(double price) {

this.price = price;

}

public String toString()

{

return "Name : "+name+" Price : "+price;

}

}