Categories: Uncategorized

Assignment Paper

Problem 2: Menu (10 points) A restaurant offers the menu below for take out. Customers can order any combination of the three items on the menu. Each item may be ordered 1-10 times. After an order is placed, every single item ordered is printed on the bill with the total price of the entire order at the bottom. For example, an order of one cheese salad and three pepperoni burgers would result in a bill showing Cheese Salad once and listing Pepperoni Burger three times. The Menu: Cheese Salad Pepperoni Burger Caesar Pizza Sample Output Menu: 1. Cheese Salad ($2) 2. Pepperoni Burger ($3) 3. Caesar Pizza ($1) 0. Done (complete order) What would you like to order? 2 How many? 4 What would you like to order? 4 Invalid! What would you like to order? 1 How many? 15 Invalid! Choose between 1 and 10: 12 Invalid! Choose between 1 and 10: 2 What would you like to order? 2 How many? 3 What would you like to order? 0 Here′s what you ordered: – Cheese Pizza – Cheese Pizza – Pepperoni Burger – Pepperoni Burger – Pepperoni Burger Total: $10.00 Implement a program for the above desсrіption. Validate all input repeatedly until a valid input is entered. Print out the bill to the console. Hint: Use a loop to repeat the menu choice. Use a nested loop to validate the menu choice and another loop to validate the amount. Use three variables to track the number of items ordered for each menu item. You will use these variables to output the ordered items at the end using a loop. If a menu item is selected again, you may just use the latest number as shown above.

admin

Share
Published by
admin

Recent Posts

Childbirth

For this short paper activity, you will learn about the three delays model, which explains…

8 months ago

Literature

 This is a short essay that compares a common theme or motif in two works…

8 months ago

Hospital Adult Medical Surgical Collaboration Area

Topic : Hospital adult medical surgical collaboration area a. Current Menu Analysis (5 points/5%) Analyze…

8 months ago

Predictive and Qualitative Analysis Report

As a sales manager, you will use statistical methods to support actionable business decisions for Pastas R Us,…

8 months ago

Business Intelligence

Read the business intelligence articles: Getting to Know the World of Business Intelligence Business intelligence…

8 months ago

Alcohol Abuse

The behaviors of a population can put it at risk for specific health conditions. Studies…

8 months ago