Computers and Technology

Requirements description: Assume you work part-time at a Cafe. As the only employee who knows java programming, you help to write an ordering application for the store.
The following is a brief requirement description with some sample output.
1. Selecting Breakfast or Lunch(5 points)
When the program starts, it first shows option Breakfast or Lunch. A sample output is as follows.
=== Select Breakfast or Lunch: ===
1. Breakfast
2. Lunch
You are supposed to validate the input.
If the user enters a letter or a number not between 1 and 2, the user will see an error message.
A sample output for invalid number is as follows.
Select Breakfast or Lunch [1, 2]: 0
Error! Number must be greater than 0.
Select Breakfast or Lunch [1, 2]:
2. Selecting Coffee (20 points)
When the program continues, it shows a list/menu of coffee and their prices, then asks a user to select a coffee by entering an integer number. A sample output is as follows.
=== Select Coffee: ===
1 Espresso $3.50
2 Latte $3.50
3 Cappuccino $5.00
4 Cold Brew $3.00
5 Quit Coffee selection
Select a coffee [1, 5]:
You are supposed to validate the input.
If the user enters a letter or a number not between 1 and 5, the user will see an error message.
A sample output for invalid number is as follows.
Select a coffee [1, 5]: 0
Error! Number must be greater than 0.
Select a coffee [1, 5]:
In your program, you can hard-code the information for coffee (i. e., coffee names and prices) shown above, such as "1 Espresso $3.50" and use the hard-code price, such as 3.50, for calculation of a total price of the order.
After the user makes a choice for coffe, such as 2 for Latte. The program continues asking for selecting a coffee so that the user can have multiple coffee orders. The user can enter "5" to quit coffee selection. A sample output is as follows.
=== Select Coffee: ===
1 Espresso $3.50
2 Latte $3.50
3 Cappuccino $5.00
4 Cold Brew $3.00
5 Quit Coffee selection
Select Coffee: [1, 5]: 2
=== Select Coffee: ===
1 Espresso $3.50
2 Latte $3.50
3 Cappuccino $5.00
4 Cold Brew $3.00
5 Quit Coffee selection
Select Coffee: [1, 5]: 5
3. Selecting Food (10 points)
After Coffee selection, the program shows food selection. A sample output is as follows.
=== Select Food: ===
1 Tuna Sandwich $10.00
2 Chicken Sandwich $10.00
3 Burrito $12.00
4 Yogurt Bowl $8.00
5 Avocado Toast $8.00
6 Quit Food selection
Select Food: [1, 6]: 1
Input validation is needed and works as before. Like Coffee selection which allows selecting multiple Coffee orders, food selection also repeats after the user enters a valid number between 1 and 5.
You hard-code the information for food shown above, such as "1 Tuna Sandwich $10.00" and use the hard-code price, such as 10.00, for calculation of the total price of the order.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 12:00, lyn94
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
image
Computers and Technology, 23.06.2019 12:40, melaniem50
Curriculum exam to process a resident's payment, you must click on onesite payments home page. from the a. reports b. my settings o c. transactions o d. rent tab
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, Auttyrain3929
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
image
Computers and Technology, 24.06.2019 18:20, mshepherdmiller
Acommon algorithm for converting a decimal number to binary is to repeatedly divide the decimal number by 2 and save the remainder. this division is continued until the result is zero. then, each of the remainders that have been saved are used to construct the binary number. write a recursive java method that implements this algorithm. it will accept a value of int and return a string with the appropriate binary character representation of the decimal number. my code: public class lab16{public string converttobinary(int input){int a; if(input > 0){a = input % 2; return (converttobinary(input / 2) + "" +a); } return ""; } }
Answers: 1
Do you know the correct answer?
Requirements description: Assume you work part-time at a Cafe. As the only employee who knows java...

Questions in other subjects: