Provide details on what you need help with along with a budget and time limit. Questions are posted anonymously and can be made 100% private.
Match with a Tutor
Studypool matches you to the best tutor to help you with your question. Our tutors are highly qualified and vetted.
Get Quality Help
Your matched tutor provides personalized help according to your question details. Payment is made only after you have completed your 1-on-1 session and are satisfied with your session.
You will create a straightforward Pizza ordering system using class inheritance. The final project will
consist of three files:
MainPizza.java
This is the control program (contains the main method)
Pizza.java
This is the Pizza class definition (contains the constructor and get and set methods)
Cheese.java
This class extends the Pizza class
You will create a simple pizza ordering system using polymorphism.
Requirements for each file:
MainPizza.java
Request pizza type (Meat or Cheese) from user (scanner)
Create a single pizza (for either Cheese or Meat)
o
o
If meat is requested, then
Instantiate your pizza as Pizza myPizza with no arguments and set the type to
Meat
Using the constructor
If Cheese is selected, then
Instantiate your pizza as Cheese myPizza with no arguments
Output your order details (based upon Cheese or Meat) as shown:
Pizza.java
The default constructor should set pizzaType to Meat and the price to $6
setCrust method should allow selection of Thick or Thin
setIngredients method should allow for only one ingredient
setCost method will add $2 to the cost of the pizza
Create the appropriate accessor methods (note all instance variables should be private)
Cheese.java
Set the pizza type to cheese using the constructor
setCrust method (not the same as Pizza setCrust method) sets the crust to Thin
Probable output
What type of pizza would you like to buy (Cheese or Meat)?: Cheese
Your Order is:
Cheese pizza
Thin crust
Total cost is $6.00
What type of pizza would you like to buy (Cheese or Meat)?: Meat
What type of crust (Thin or Thick)?: Thick
What ingredient (limit one)?: Sausage
Your order is:
Meat pizza
Sausage (+ $2.00)
Thick crust
Total cost is $8.00
Purchase answer to see full
attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Would you like to help your fellow students? Are you in need of an additional source of income? Apply to become a tutor on Studypool! Our best tutors earn over $7,500 each month!