*Please ONLY IN JAVA & use NetBeans IDE IfPossible*
Turn in: In NetBeans, export your NetBeans project to a zip file, name it as YourLastName_FirstName_project.zip. Requirements description: Assume you work part-time at a restaurant. As the only employee who knows java programming, you help to write a pizza ordering application for the restaurant. The following is a brief requirement description with some sample output. 1. Welcome Menu (5 points) When the program starts, it first shows welcome page. A sample output is as follows. ======Welcome to Pizza Ordering System====== ===Select Customer Selection or Exit [1, 2] === 1. Customer Selection 2. Exit You are supposed to validate the input. If the user enters a letter or a number not 1 or 2, the user will see an error message. A sample output for invalid number is as follows. Select Customer Selection or Exit [1, 2]: a Error! You must type a number. Select Customer Selection or Exit [1, 2]: 3 Error! Number must be 1 or 2. If the customer picks option 1, the program continues. If the customer picks option 2, the program terminates. 2. Selecting Pizza (20 points) If the customer picks option 1 from the welcome menu, the program continues. Then it shows a list/menu of pizza and their prices. It will ask a user to select a pizza by entering a whole number. A sample output is as follows: === Select Pizza: === 1 Hawaiian Pizza Extra Large $14.00 2 Hawaiian Pizza Regular $12.00 Pizza Extra Large $12.00 Pizza Regular $10.00 Pizza Extra Large $10.00 Pizza Regular $8.00 Pizza Extra Large $10.00 Pizza Regular $8.00 3 Buffalo 4 Buffalo 5 Cheese 6 Cheese 7 Veggie 8 Veggie 9 Quit Pizza selection
You are supposed to validate the input. If the user enters a letter or a number not between 1 and 9, the user will see an error message. A sample output for invalid number is as follows. Select Pizza [1, 9]: b Error! You must type a number. Select Pizza [1, 9]: 10 Error! Number must be between 1 and 9. In your program, you can hard-code the information for pizza (i.e., pizza names and prices) shown above, such as "1 Hawaiian Pizza Extra Large $14.00 and use the hard-code price, such as 14.00, for calculation of a total price of the pizza order. After the user makes a choice for pizza, such as 2 for Hawaiian Pizza Regular. The program continues asking for selecting a pizza so that the user can have multiple pizza orders. The user can enter "9" to quit pizza selection. A sample output is as follows. === Select Pizza: === 1 Hawaiian Pizza Extra Large Pizza Regular 2 Hawaiian 3 Buffalo Pizza Extra Large Pizza Regular 4 Buffalo 5 Cheese 6 Cheese 7 Veggie 8 Veggie Pizza Extra Pizza Regular Pizza Extra Large Pizza Regular 9 Quit Pizza selection Select Pizza: [1, 9]: 2 ===Select Pizza: ==== 1 Hawaiian Pizza Extra Large 2 Hawaiian Pizza Regular 3 Buffalo Pizza Extra Large 4 Buffalo Pizza Regular DA D Pizza Extra Large SAN Pizza Regular 5 Cheese 2 6 Cheese 7 Veggie 8 Veggie 9 Quit Pizza selection Select Pizza: [1, 9]: 5 Pizza Extra Large Pizza Regular ===Select Pizza: === 1 Hawaiian Pizza Extra Large 2 Hawaiian 3 Buffalo Pizza Regular Pizza Extra Large 4 Buffalo 5 Cheese 6 Cheese 7 Veggie 8 Veggie 9 Quit Pizza selection Select Pizza: [1, 9]: 9 $14.00 $12.00 $12.00 $10.00 $10.00 $8.00 $10.00 $8.00 $14.00 $12.00 $12.00 $10.00 $10.00 $8.00 $10.00 $8.00 $14.00 $12.00 $12.00 $10.00 Pizza Regular Pizza Extra Large Pizza Regular Pizza Extra Large $10.00 Pizza Regular $8.00 $10.00 $8.00
3. Selecting Drinks (10 points) After pizza selection, the program shows drinks selection. A sample output is as follows. === Select Drinks: === 1 Ice Tea $1.50 2 Soft Drinks $2.00 3 Bottled Water 4 Espresso pap Latte 5 $1.50 $4.50 $4.50 $6.00 $4.00 6 Cappuccino 7 Cold Brew 8 Quit Drinks selection Select Drinks: [1, 8]: You are supposed to validate the input. If the user enters a letter or a number not between 1 and 8, the user will see an error message. A sample output for invalid number is as follows. Select Drinks [1, 8]: b Error! You must type a number. Select Drinks [1, 8]: 10 Error! Number must be between 1 and 8. In your program, you can hard-code the information for drinks (i.e., drink names and prices) shown above, such as "1 Ice Tea $1.50 and use the hard-code price, such as 1.50, for calculation of a total price of the order. After the user makes choice for drinks, such as 5 for Latte. The program continues asking for selecting a drink so that the user can have multiple drink orders. The user can enter "8" to quit drink selection. A sample output is as follows. === Select Drinks: === 1 Ice Tea $1.50 2 Soft Drinks $2.00 3 Bottled Water $1.50 $4.50 $4.50 $6.00 4 Espresso 5 Latte 6 Cappuccino 7 Cold Brew DIE 8 Quit Drinks selection Select Drinks: [1, 8]: 5 === Select Drinks: == 1 Ice Tea 2 Soft Drinks 3 Bottled Water. 4 Espresso 5 Latte $4.00 2.00 $1.50 $2.00 $1.50 $4.50 $4.50 $6.00 $4.00 6 Cappuccino 7 Cold Brew 8 Quit Drinks selection Select Drinks: [1, 8]: 8
4. Entering a customer's name and phone number (10 points) After making a Drink selection, the program asks for the user's name so that the user can enter text like John or John Smith. ===Select Drinks: === $1.50 $2.00 $1.50 $4.50 1 Ice Tea 2 Soft Drinks 3 Bottled Water 4 Espresso 5 Latte 6 Cappuccino 7 Cold Brew $4.50 $6.00 $4.00 8 Quit Drinks selection Select Drinks: [1, 8]: 8 Enter customer's name: John Smith Enter customer's phone number: 626-111-2222 5. Displaying and writing order line information (35 points) After entering a name, the program prints details for this order line in computer monitor. The information includes the five fields: customer name, customer phone number, pizza name (quantity), drink name (quantity), and a (formatted) total price, and each field is separated by simi colon and a space. A sample output to the monitor is as follows. Enter customer's name: John Smith Enter customer's phone number: 626-111-2222 Customer name: John Smith; Phone: 626-111-2222 Hawaiian Pizza Regular (1); Cheese Pizza Extra Large (1); Latte (1) Total: $26.50 Besides showing on monitor, the same order line content is written (appended) to a text file named pizzaorder.txt and each order line occupies three lines in the text file. Here is a specific example for an order in the pizzaorder.txt. Customer name: John Smith; Phone: 626-111-2222 Hawaiian Pizza Regular (1); Cheese Pizza Extra Large (1); Latte (1) Total: $26.50 Your program needs to create the output file, named pizzaorder.txt, if it doesn't exist yet, and later appends (not overwrite) order line information to the file. So next time when your program is executed, new order information will be appended to the pizzaorder.txt file. You must use a relative path when creating an output stream writer object. Design requirements: (20 points) You must have at least the following java classes. You may have additional classes if you want. [1] a PizzaOrder class to simulate the PizzaOrder entity in real world, which has fields of pizza, drinks, price of the order, customer name, customer phone number and corresponding methods. This class also provides a method to append the content of an order's content to the output text file, pizzaorder.txt. (PizzaOrder.java) [2] a java application, named OrderApp.java, that contains a main method. This class interacts with PizzaOrder class.
*Please ONLY IN JAVA & use NetBeans IDE If Possible*
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am