Question: The class Cashier generates an Order. Its takeOrder method accepts user input from the keyboard to generate the Order. This is a sample run (the
The class Cashier generates an Order. Its takeOrder method accepts user input from the keyboard to generate the Order. This is a sample run (the user inputs are underlined ):
Welcome!



The interface must meet the following requirements: The menu is displayed at the start of the input, and after that only when requested. o Inputs end with the Enter key. o Entering e as a command ends the order. o Entering a valid item number causes the Cashier to ask for the quantity of that item. o Entering anything else as a command causes the menu to reprint. o Items may be requested many times, and their quantities are incremented with each request - i.e. they should appear only once in the receipt. o Only quantities greater than 0 are recorded. Any other value entered for a quantity is ignored. o Print Not a valid number on any bad command or quantity input. o Print a receipt when the order ends. o An order may be empty. You may write as many private helper methods for Cashier as you like.
Step by Step Solution
3.31 Rating (151 Votes )
There are 3 Steps involved in it
Based on the provided sample run and requirements heres a possible implementation of the Cashier class in Java java import javautilHashMap import java... View full answer
Get step-by-step solutions from verified subject matter experts
