Assignment 6: Restaurant Please complete the program described below. You will turn in to the dropbox:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Assignment 6: Restaurant Please complete the program described below. You will turn in to the dropbox: The code, as a plaintext file (use cat filename.c to print out the file. Highlight it to copy, then paste into a text editor) A screenshot of the code running with your name included The file must be named menu.c located in a folder called a6 in your home directory You are going to help craft a restaurant's menu system. Create a struct to represent a menu item. It will have the fields "name", "price", and "calories". In your main function, do the following. o Create an array of 5 menu items. Hard code starting values for these items. You can make them whatever you want. For instance, "Cheeseburger", 2.99, 650 o While the user does not input-1, display the following choices to the user. 1: Print menu 2: Order an item 3: Edit an item on the menu -1: Exit o Use the functions described below to help with this process. For #3, ask the user which item (1-5) they want to edit, and use your make menu item function to overwrite the value in your array. You MUST use function prototypes for this assignment. Create a function to print a single menu item. This function should take your struct as input and return nothing. It should look nice, although the specifics are up to you. o Cheeseburger o $2.99, 650 calories Create a function to make a menu item. It should take no input, and return your struct. You should scan all necessary values from the user. Create a function to order an item. It should take your array as input, and return nothing. Let the user enter a number 1-5 to order something, then thank the user for ordering. Print out the total for the order. o Thanks for ordering the Cheeseburger. Your total is $2.99. Welcome to the restaurant ! 1) Display menu. (2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: 1 Item 1 Cheeseburger $2.99, 650 calories Item 2 Chicken Strips $1.99, 550 calories Item 3 Fries $1.09, 300 calories Item 4 Salad $2.99, 175 calories Item 5 Sandwich $1.50, 425 calories Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: 2 Which item do you want to order? (1-5): 3 Thanks for ordering the Fries. Your total is $1.09 Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: 3 Which item do you want to edit? (1-5) 4 Name of the new item: Milkshake Price of the item: 1.50 Calories in the item: 500 Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: 1 Item 1 Cheeseburger $2.99, 650 calories Item 2 Chicken Strips $1.99, 550 calories Item 3 Fries $1.09, 300 calories Item 4 Milkshake $1.50, 500 calories Item 5 Sandwich $1.50, 425 calories Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: -1 Assignment 6: Restaurant Please complete the program described below. You will turn in to the dropbox: The code, as a plaintext file (use cat filename.c to print out the file. Highlight it to copy, then paste into a text editor) A screenshot of the code running with your name included The file must be named menu.c located in a folder called a6 in your home directory You are going to help craft a restaurant's menu system. Create a struct to represent a menu item. It will have the fields "name", "price", and "calories". In your main function, do the following. o Create an array of 5 menu items. Hard code starting values for these items. You can make them whatever you want. For instance, "Cheeseburger", 2.99, 650 o While the user does not input-1, display the following choices to the user. 1: Print menu 2: Order an item 3: Edit an item on the menu -1: Exit o Use the functions described below to help with this process. For #3, ask the user which item (1-5) they want to edit, and use your make menu item function to overwrite the value in your array. You MUST use function prototypes for this assignment. Create a function to print a single menu item. This function should take your struct as input and return nothing. It should look nice, although the specifics are up to you. o Cheeseburger o $2.99, 650 calories Create a function to make a menu item. It should take no input, and return your struct. You should scan all necessary values from the user. Create a function to order an item. It should take your array as input, and return nothing. Let the user enter a number 1-5 to order something, then thank the user for ordering. Print out the total for the order. o Thanks for ordering the Cheeseburger. Your total is $2.99. Welcome to the restaurant ! 1) Display menu. (2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: 1 Item 1 Cheeseburger $2.99, 650 calories Item 2 Chicken Strips $1.99, 550 calories Item 3 Fries $1.09, 300 calories Item 4 Salad $2.99, 175 calories Item 5 Sandwich $1.50, 425 calories Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: 2 Which item do you want to order? (1-5): 3 Thanks for ordering the Fries. Your total is $1.09 Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: 3 Which item do you want to edit? (1-5) 4 Name of the new item: Milkshake Price of the item: 1.50 Calories in the item: 500 Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: 1 Item 1 Cheeseburger $2.99, 650 calories Item 2 Chicken Strips $1.99, 550 calories Item 3 Fries $1.09, 300 calories Item 4 Milkshake $1.50, 500 calories Item 5 Sandwich $1.50, 425 calories Welcome to the restaurant! 1) Display menu. 2) Order an item. 3) Edit a menu item (Employees only!) -1) Exit Make a selection: -1
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Identify business objectives and needs What product are you planning on cross promoting to your existing client base? (Goal 2). Rank your business goals in order of priority.
-
The site http://virtualpiano.net features an online player piano. If you click on the Key Assist menu just above the piano keyboard, and then Keyboard Keys, you will see that each key is labelled...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
With a global economy, the only way to achieve cost-effective control of greenhouse gases is to assure that every country imposes the same universal set of emissions standards. Discuss.
-
A non-uniform electric field is given by the expression E = ayi + bzj + cxk, where a, b, and c are constants. Determine the electric flux through a rectangular surface in the xy plane, extending from...
-
X-rays of wavelength 10.0 pm are incident on a target. Find the wavelengths of the x-rays scattered at? (a) 45.0 (b) 90.0
-
A manufacturer of submersible pumps claims that at most \(30 \%\) of the pumps require repairs within the first 5 years of operation. If a random sample of 120 of these pumps includes 47 which...
-
Pretty Pets is a small etail business specializing in the sale of exotic pet gifts and accessories over the web. The business is owned by a sole proprietor and operated out of her home. Results for...
-
A ray of light is traveling from water (n = 1.33) into an unknown substance. The angle of incidence at the boundary is 35 degrees and the refracted angle is 52 degrees. A) Calculate the index of...
-
Create a new What SUP Operating Cash Payments Budget Using the ch6-03 file to start your work, create a worksheet similar to the one created in this chapter to budget operating cash payments by month...
-
Consider a monopolist facing two consumers whose preferences for its product are given by the following demand curves: P=20-Q, and P-12-20. The monopolist's fixed cost is equal to 0 and marginal cost...
-
Early in its fiscal year ending December 31, 2024, San Antonio Outfitters finalized plans to expand operations. The first stage was completed on March 28 with the purchase of a tract of land on the...
-
Kinette, age 16, has dividend income of $2,800 and interest income of $935. She has no investment expenses. Determine the net unearned income for the purpose of the kiddie tax.
-
Pharoah Company reported the following amounts for 2022: Raw materials purchased $95,200 Beginning raw materials inventory 5,824 Ending raw materials inventory 5,040 Beginning finished goods...
-
1. You currently owe $18,000 on a car loan at 8.0% interest. If you make monthly payments of $576.49 per month, how long will it take you to repay the loan? Please state the time in months. 2. You...
-
write down the definitions for the following terms. (1) International Business Law: (2) Continental Law: (3) Strict liability: (4) Endorsement: (5) Arbitration: answer the following questions. (1)...
-
ET owns a tract of land which it purchased in 2011 for P100,000. The land is held as a future plant site and has a fair market value of P140,000 on July 1, 2014. RS also owns a tract of land held as...
-
In a paragraph of approximately 150-200 words, analyze a film or TV/Streaming Show poster of your choosing by focusing on the ways in which representations in the poster are gendered. Include an...
-
Harold Conners (Social Security number 785-23-9873) lives at 13234 DeMilo Drive, Houston, TX 77052, and is self-employed for 2012. He estimates his required annual estimated tax payment for 2012 to...
-
Karim Depak received a Form 1099-B showing the following stock transactions and basis during 2012: None of the stock is qualified small business stock. Calculate Karim's net capital gain or loss...
-
Ken paid the following amounts for interest during 2012: Qualified interest on home mortgage...........................................$4,700 Auto loan...
-
Reconsider the regression models in Problem 12.6, parts a-e. Suppose the error terms in these models were multiplicative, not additive. Rework the problem under this new assumption regarding the...
-
Sketch the expectation function for the logistic growth model (12.34) for \(\theta_{1}=1, \theta_{3}=1\), and values of \(\theta_{2}=1,4,8\), respectively. Overlay these plots on the same \(x-y\)...
-
For the models shown below, determine whether it is a linear model, an intrinsically linear model, or a nonlinear model. If the model is intrinsically linear, show how it can be linearized by a...
Study smarter with the SolutionInn App