1 a . Create a class named Pizza. Data fields include String for toppings (such as “pepperoni”), an integer for diameter in inches (such as 12) and double for price (as in 13.99). Include methods to get and set values for each of these fields. b. Create a class named TestPizza that instantiates one Pizza object and demonstrates the use of the Pizza set and get methods.
Laboratory Exercises – Java Lesson 5: Creating Classes and Objects
1 a . Create a class named Pizza. Data fields include String for toppings (such as “pepperoni”), an integer for diameter in inches (such as 12) and double for price (as in 13.99). Include methods to get and set values for each of these fields.
b. Create a class named TestPizza that instantiates one Pizza object and demonstrates the use of the Pizza set and get methods.
2. Write a
Step by step
Solved in 2 steps