subject

Two programs. Submit the source files, the captured run of the first, and both of the data files for the second. 1. Create a struct Menultem containing fields for name (a string) and price (a double) of a menu item for a diner. Create a ReadItem() function that takes an istream and a Menultem (both by reference) and prompts the user for the fields of the MenuItem, loading the values into the struct's fields. Create a PrintItem() function that takes an output stream (by reference) and a Menultem (by value) and prints the MenuItem fields to the stream in a reasonable one-line format. Create a main() that declares a Menultem struct locally, calls ReadItem(), then calls PrintItem(). Test with a few different items.
2. Make another program modified to include an array of 10 MenuItem structs. Modify ReadItem() to not prompt for, but instead just read the data for a struct field-by-field, and call it once for each Menultem. Then call PrintItem() for cach struct, numbering the items to create a menu (see below). Use files, opened and closed in main(), for all input and output. Create a test file with the 10 items and prices, and test with it. Send me the test file and the output file. (30 points) Hints: If you use an istream & for an input stream parameter, you may pass either cin or an input file handle to a function.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print?
Answers: 3
question
Computers and Technology, 22.06.2019 15:30
Which of the following examples has four beats in each measure?
Answers: 2
question
Computers and Technology, 22.06.2019 19:10
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
You know the right answer?
Two programs. Submit the source files, the captured run of the first, and both of the data files for...
Questions
question
Mathematics, 27.08.2019 23:00
question
Physics, 27.08.2019 23:00