Question: write a program for a pizzeria. A pizza has a name, number of ingredients, an arrangement of ingredients (String arrangement) and price. Create a class

write a program  for a pizzeria. A pizza has a name, number of ingredients, an arrangement of ingredients (String arrangement) and price. Create a class to represent pizza. 

 

o The class must have a default constructor and a parameterized constructor. 

 

o Add a method that allows keyboard entry of pizza data (all data is entered except for the price). 

 

o Add a method that allows you to calculate the price of the pizza considering that if it has only two ingredients its price is $5.00 and for each additional ingredient its price will increase by $1.00. 

 

o Add a method that allows you to display all the pizza data, including its calculated price. 

 

o Create an additional class that contains the main method and test your Pizza class by creating several objects and calling their data input, calculation, and display methods.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The detailed answer for the above question is provided below Heres a Java program that implements the Pizza class with the specified requirements impo... View full answer

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 Programming Questions!