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, 24.06.2019 04:30
How do you share someone else’s tweet with your own twitter followers?
Answers: 1
question
Computers and Technology, 24.06.2019 07:40
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
question
Computers and Technology, 24.06.2019 09:30
Atype of researcher who uses computers to make sense of complex digital data
Answers: 1
question
Computers and Technology, 24.06.2019 23:00
Why is it preferable to code web pages in html format? a. to create more lines code b. to apply general formatting rules c. to display properly as search results in all browsers d. to add meaning to the document
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
English, 30.01.2021 20:30
question
Mathematics, 30.01.2021 20:30
question
Mathematics, 30.01.2021 20:30
question
Business, 30.01.2021 20:30
Questions on the website: 13722360