Problem

This programming project extends Programming Project 4.11. Create a Pizza- Order class tha...

This programming project extends Programming Project 4.11. Create a Pizza- Order class that allows up to three pizzas to be saved in an order. Each pizza saved should be a Pizza object as described in Programming Project 4.11. In addition to appropriate instance variables and constructors, add the following methods:

•public void set Num Pizzas (int num Pizzas)—sets the number of pizzas in the order. num Pizzas must be between 1 and 3.

• Public void setpizzal(pizza pizza1)— sets the first pizza in the order.

• Public void setpizza (pizza pizza2)— sets the second pizza in the order.

• Public void setpizza (pizza pizza3)— sets the third pizza in the order.

•Public double calctatal()—Returns the total cost of order.

Write a main method to test the class. The set pizza2 and setpizza3 method only will be used if there are two or three pizza in the order, repectively. Sample code illustrating the method is shown below. Note that first three lines are incomplete. You must complete them as part of the programming project.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 4
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT