Write test code to create several pizzas and output their


-Private instance variable to store the size of the pizza (either small, medium, or larger), the number of cheese toppings, the number of pepperoni toppings, and the number of ham toppings.

-Constructor that set all of the instance variables. '

-Public methods to get and set the instance variables.

-A public method named calsCost() that returns a double that is the cost of the pizza.

Pizza cost is determined by:

Small: $10 + $2 per topping

Medium: $12 + $2 per topping

Large: $14 + $2 per topping.

-A public method named getDescription() that returns a String containing the pizza cost as calculated by calsCost ()

Write test code to create several pizzas and output their descriptions. For example, a large pizza with one cheese, one pepperoni and two ham toppings should cost a total of $22

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write test code to create several pizzas and output their
Reference No:- TGS02384109

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)