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 06:30
This technology is used to produce high-quality documents that look good on the computer screen and in print.
Answers: 1
question
Computers and Technology, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Which software would you use to create a print design? a. illustrator b. audacity c. reaper d. dreamweaver
Answers: 2
question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
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
History, 19.02.2021 15:30
question
Mathematics, 19.02.2021 15:30
Questions on the website: 13722367