Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Create a class named Pizza. This class should have three fields : a String for topping ( such as pepperoni, e.) , an integer for diameter in inches (...

Create a class named Pizza. This class should have three fields : a String for topping ( such as pepperoni, e.g.) , an integer for diameter in inches ( such as 12, e.g.), and a double for price (e.g., 13.99). Code the proper accessor and mutator methods (i.e. getter and setter for each field variable) to access fields and assign values to all fields. A Pizza class should have also the overloaded constructor which accepts three parameters (topping, diameter and price), and assigns the values passed via these parameters to the  Pizza class fields. Save the class as Pizza.java.

Write a class named TestPizza (a driver class) with the main method. This class instantiates a myPizza object form the Pizza class  and assigns  specific values of topping , diameter and price. These values should be taken as  a user’s input making use of JOptionPane or Scanner classes.  When the data is  assigned to myPizza object fields,   display all the values associated with myPizza object of the Pizza class. Provide   proper label for each property  (e.g., “My Pizza topping is: pepperoni” etc)

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question