Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part B: Create a FastFoodKitchen class that handles BurgerOrders. Objective: To create an ArrayList of BurgerOrder objects that allows orders to be added and removed

Part B: Create a FastFoodKitchen class that handles BurgerOrders. Objective: To create an ArrayList of BurgerOrder objects that allows orders to be added and removed as they are completed. 1) Add another class to your module called FastFoodKitchen (see steps 1 and 2 in Part A for guidance if you dont remember how). 2) At the top of your FastFoodKitchen class, add an ArrayList of BurgerOrder objects called orderList. Make orderList private. 3) Add a second field that is an int called nextOrderNum, making it both private and static Page 6 of 11 4) Add a getter method for the nextOrderNum field. We do not need a setter method for this field. 5) Add a new private static void method that is called incrementNextOrderNum() that does exactly that adds one to the nextOrderNum field. This must be called each time after creating a new order, to make sure that no order ever has the same order id number. 6) Create a constructor for FastFoodKitchen that populates orderList with an initial set of three orders using the same numbers of items as the three orders in the test code for Part A You will need to call the getNextOrderNum() method to specify the order id number, and you must call incrementNextOrderNum() after you add each order. 7) Now we are ready to add methods to handle placing and managing orders in a fastfood kitchen. Add the following methods to FastFoodKitchen. The bullet points under each tell you what the method must do. public int addOrder(int ham, int cheese, int veggie, int soda, boolean TOGO) o Using the values of the parameters, create a new BurgerOrder, using the next order number available o Add this new BurgerOrder to orderList o Increment nextOrderNum o Return the order id number of the order you just created public boolean isOrderDone(int orderID) o Iterate through orderList, checking each order. o If there is an order in the list whose order number matches orderID, the order is still in progress, so return false o If there isnt an order in the list that matches orderID, return true

This in Java. Can someone explain how to write the final method that is bold/italicized?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

3. What are potential solutions?

Answered: 1 week ago