Demonstrating inheritance


Your Pizza Shop expands and now handles delivery orders and sit down orders in a restaurant setting. There are differences in a SeatedPizzaOrder and a DeliveryPizzaOrder. These are more specialized versions of the PizzaOrders you have been creating all along and you decide to write a program that handles them the same as much as possible and reuses the code of a general PizzaOrder class as much as possible to demonstrate inheritance.

Create a PizzaOrder Class. This class should have the following properties (and their underlying private variables): Size {of type int}, Toppings {of type String}, Price {of type Decimal}. Make a full constructor for the class that takes all three values, and a default constructor that initializes the basic pizza as a 12 inch cheese pizza for $8. Make sure to include validation in your Size and Price properties and constructor to prevent a change to Size that would be less than 12 or greater than 16, and prevent a change to Price that would be less than 0.

Create a class that inherits from your PizzaOrder class called SeatedPizzaOrder. SeatedPizzaOrder has the three data values that any PizzaOrder has (size, toppings, and price) but also has a tablenumber (of type integer) and serverName (of type string) which allows you to track where the pizza is going and who took the order in the restaurant

Create a class that inherits from your PizzaOrder class called DeliveryPizzaOrder. DeliveryPizzaOrder has the three data values that any PizzaOrder has (size, toppings, and price) but also has a driverName (of type string) which allows you to track who is delivering the pizza.

Create a GUI with controls of your choosing or a console class with a main in it. The choice is up to you to create objects of each and test them. This program should allow the user to enter in the values for a SeatedPizzaOrder and the values for a DeliveryPizzaOrder, and after creating an object of each one, it should displays their values (from the created objects) for the user.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Demonstrating inheritance
Reference No:- TGS0535825

Expected delivery within 24 Hours