Question: JAVA Create a class named Pizza with data fields for description (such as sausage and onion ) and price. Include a constructor that requires arguments

JAVA

Create a class named Pizza with data fields for description (such as sausage and onion) and price. Include a constructor that requires arguments for both fields and a method to display the data. Create a subclass named DeliveryPizzathat inherits from Pizza but adds a delivery fee and a delivery address. The description, price, and delivery address are required as arguments to the constructor. The delivery fee is $3 if the pizza ordered costs more than $15; otherwise it is $5. Write an application that instantiates at least two objects of each type, and display the values. Save the files as Pizza.java, DeliveryPizza.java, and DemoPizzas.java.

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!