Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

OVERVIEW 1) Part A: Canceling orders in FastFoodKitchen (1 point) 2) Part B: Adding pricing to orders (1 point) 3) Part C: Changing prices (1

image text in transcribed
OVERVIEW 1) Part A: Canceling orders in FastFoodKitchen (1 point) 2) Part B: Adding pricing to orders (1 point) 3) Part C: Changing prices (1 point) 4) Bonus! Part A: Canceling orders (1 point) Objective: To create a new method in Fast Food Kitchen, and update the menu options to allow you execute that method. 1) Add the following method to FastFoodKitchen. public boolean cancelOrder (int orderID) 1) Iterate through order List, checking each order. 2) If there is an order in the list whose order number matches orderID, remove the order from the order List and return true 3) If there isn't an order in the list that matches orderID, return false 2) In the Lab4Test Project.java file, make the following changes: 4) Add a new menu option for Cancel an order 5) Add a new case to the switch statement for this new option . Ask user to enter the order number for the order they want to cancel . Call the cancelOrder method with user entered order number . If the method retums true, display "Your order has been successfully cancelled" . Otherwise, display "Sorry, we can't find your order number in the system" Test your code to verify it works. If you are satisfied with it, show it to the professor or TA for credit. Part B: Adding Menu Pricing (1 point) Objective: To add pricing information for the various items offered by the Fast Food Kitchen 1) Add four new static fields to our BurgerOrder class. We will use these fields in order to generate prices and totals for our orders. These fields should be called burger Price, cheeseburger Price, veggie Burger Price, and sodaPrice. What data type is best suited for storing these values? Give each field an initial value. (It would be a good idea to give these a simple number to start to make sure it is easy for you to verify totals). 2) Add getters for these fields. Notice, all of these getters also have the static keyword. Why is that? 3) Create a new method that will get the total cost of a BurgerOrder, and return the value. Should this method be static or non-static? 4) Modify the addOrder method you wrote to include a print statement that will tell the user the total cost of their order. 5) When you are satisfied that your code works as it should, show it to the professor or TA for credit. Page 1 of 2 OVERVIEW 1) Part A: Canceling orders in FastFoodKitchen (1 point) 2) Part B: Adding pricing to orders (1 point) 3) Part C: Changing prices (1 point) 4) Bonus! Part A: Canceling orders (1 point) Objective: To create a new method in Fast Food Kitchen, and update the menu options to allow you execute that method. 1) Add the following method to FastFoodKitchen. public boolean cancelOrder (int orderID) 1) Iterate through order List, checking each order. 2) If there is an order in the list whose order number matches orderID, remove the order from the order List and return true 3) If there isn't an order in the list that matches orderID, return false 2) In the Lab4Test Project.java file, make the following changes: 4) Add a new menu option for Cancel an order 5) Add a new case to the switch statement for this new option . Ask user to enter the order number for the order they want to cancel . Call the cancelOrder method with user entered order number . If the method retums true, display "Your order has been successfully cancelled" . Otherwise, display "Sorry, we can't find your order number in the system" Test your code to verify it works. If you are satisfied with it, show it to the professor or TA for credit. Part B: Adding Menu Pricing (1 point) Objective: To add pricing information for the various items offered by the Fast Food Kitchen 1) Add four new static fields to our BurgerOrder class. We will use these fields in order to generate prices and totals for our orders. These fields should be called burger Price, cheeseburger Price, veggie Burger Price, and sodaPrice. What data type is best suited for storing these values? Give each field an initial value. (It would be a good idea to give these a simple number to start to make sure it is easy for you to verify totals). 2) Add getters for these fields. Notice, all of these getters also have the static keyword. Why is that? 3) Create a new method that will get the total cost of a BurgerOrder, and return the value. Should this method be static or non-static? 4) Modify the addOrder method you wrote to include a print statement that will tell the user the total cost of their order. 5) When you are satisfied that your code works as it should, show it to the professor or TA for credit. Page 1 of 2

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions