Reference no: EM133703530
You have been asked to help the restaurant develop a new point of sale program. As the restaurant is just getting up and running the first iteration of the program will be limited. The program must prompt the user to determine the number of sandwiches, wings, and sodathe user would like to order and generate the sales receipt. All orders will receive a special "VIP" discount to encourage customers to visit.
Concepts • Scanner • Mathematical operators • Variable handling • Print formatting
1. In main, declare and assign double variables for the cost of sandwiches, wings, soda and the amount of the "VIP" discount. The values are as follows: Item Value sandwiches$5.50. wings $3.25. soda $2.00. "VIP" Discount $1.50. Note: These variables are constants (variables that should not change), which are not covered until later in the semester. However, for your awareness, the naming convention for constants is all uppercase with words separated by underscores. For example, SANDWICHES_COST. This naming convention is encouraged, but not required at this time.
Step 2 Print the welcome message. Note: Welcome message and all other text can be seen in the screenshots located in the Example Output section of this document.
Step 3 use an instance of the Scanner object. Ensure the scanner object is closed when it is no longer needed.
Step 4 Prompt the user for the count of sandwiches to add to the order. Repeat for wings and soda. All food items can only be ordered in whole number quantities, no partial orders. Note: You can assume a well-behaved user; meaning the user will enter a valid input for each prompt. No input validation or error handling is necessary at this point.
Step 5 Calculate the order subtotal and apply the "VIP" discount. For this version every order will receive a discount. The subtotal is the sum of the count of each item times its cost, minus the VIP discount. subtotal = sandwiches cost∗ count sandwiches + wings cost∗ count wings+ sodacost ∗ count soda- VIP discount
Step 6 Calculate the tax and total. The tax is 6 percent of the subtotal, and the total is the subtotal plus tax. tax = subtotal ∗ .06 total = subtotal + tax
Step 7 Calculate the average cost per item sold. The average cost includes the "VIP" discount and tax. average cost ??er item = total / total items sold
Step 8 Display the receipt using any combination of print, println, and printf. All values representing currency must include a $ and be formatted with two digits after the decimal point. The "VIP" discount must include quotations in the label and parenthesis around the dollar amount. Receipt formatting must be the same as the screenshots in the Example Output section.