View the step-by-step solution to:


To the pizza class, add new instance variable called orderNumber. Make it an integer. Create getter only for


Add static instance variable called nextOrderNumber that starts at 1001. 

In the constructor, increase nextOrderNumber by one. (nextOrderNumber++;) Then, set the value of this.orderNumber equal to the value in nextOrderNumber (just a simple equal sign will work).

Modify the repeatOrder() method to print out the orderNumber too. It should look something like this:

Pizza 1 info: Order number: 1002, Topping: mushroom, Size: large, Price: $9.99

Pizza 2 info: Order number: 1003, Topping: pepperoni, Size: extra large, Price: $13.99

Top Answer

public class Pizza { //Reid private String topping; private String size; private double price; private int... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question