Lovely Warteg Lovely Warteg is a canteen that provides food service. The owner of this canteen is planning to make a program to make the transaction process of paying easier and more effective. You as a programmer are asked to create this program based on the criteria given using Java Programming Language. This application consists of 2 menus which are: Order Menu Exit Figure 1. Lovely Warteg Main Menu Order Menu The first option of the menu allows the user to order food through the program. The user is required to fill in a few user inputs which are: Ask the user to input the customer’s name. Validate that the customer’s name must be between 6 and 25 characters. Figure 2. Input Customer Name Ask the user to the input type of vegetable to eat. Validate that the vegetable must end with “Vegetable” (case sensitive). Figure 3. Type of vegetable Ask the user to the input type of meat to eat. Validate that meat must be either “Fish”, “Beef”, or “Chicken” (case sensitive). Figure 4. Input type of meat Ask the user to input portions of rice. Validate that the portions of rice must be numeric and between 1 and 5 plates. Figure 5. Input portions of rice Calculate the total price based on the type of meat and the portions of rice: The main formula for the total price is: Total price = [Type of Meat] + (1000 *s Portions of Rice) Where the price of each type of meats is: Type of Meat Price Beef 20000 Fish 15000 Chicken 10000 Show customer’s name, vegetable orders, type of Meat, portions of rice, and total price based on the inputted data. Figure 6. Check out view Then ask the user to input the amount of cash that the Customer will pay. Validate the Amount of Cash must be greater or equal to the total price. If Customer’s amount of cash is greater than the total price, then output the Customer’s Figure 7. Input amount of cash Exit If the user chooses menu 2 (“Exit”), the application will be closed.
Lovely Warteg
Lovely Warteg is a canteen that provides food service. The owner of this canteen is planning to make a program to make the transaction process of paying easier and more effective. You as a programmer are asked to create this program based on the criteria given using Java Programming Language.
This application consists of 2 menus which are:
- Order Menu
- Exit
Figure 1. Lovely Warteg Main Menu
- Order Menu
The first option of the menu allows the user to order food through the program. The user is required to fill in a few user inputs which are:
- Ask the user to input the customer’s name. Validate that the customer’s name must be between 6 and 25 characters.
Figure 2. Input Customer Name
- Ask the user to the input type of vegetable to eat. Validate that the vegetable must end with “Vegetable” (case sensitive).
Figure 3. Type of vegetable
- Ask the user to the input type of meat to eat. Validate that meat must be either “Fish”, “Beef”, or “Chicken” (case sensitive).
Figure 4. Input type of meat
- Ask the user to input portions of rice. Validate that the portions of rice must be numeric and between 1 and 5 plates.
Figure 5. Input portions of rice
- Calculate the total price based on the type of meat and the portions of rice:
- The main formula for the total price is:
|
- Where the price of each type of meats is:
Type of Meat |
Price |
Beef |
20000 |
Fish |
15000 |
Chicken |
10000 |
- Show customer’s name, vegetable orders, type of Meat, portions of rice, and total price based on the inputted data.
Figure 6. Check out view
- Then ask the user to input the amount of cash that the Customer will pay.
- Validate the Amount of Cash must be greater or equal to the total price.
- If Customer’s amount of cash is greater than the total price, then output the Customer’s
Figure 7. Input amount of cash
- Exit
If the user chooses menu 2 (“Exit”), the application will be closed.
Step by step
Solved in 2 steps with 1 images