Question: I'm needing help with the following c++ code: Write a C++ program that stores data to a text file. The data will be a persons

I'm needing help with the following c++ code:

Write a C++ program that stores data to a text file. The data will be a persons name followed by their age. The program should:

Have a menu that asks the user if they want to see the data in the file or write data to the file.

Have a header file that contains two functions. One gets the data from the file and the other puts the data into the file.

The write data option from the menu should call another function that receives the data from the user. Once the user has finished typing a name it should prompt them for the persons age. These two pieces of information should be stored in a vector as a single string entry delimited by some character of your choice. This function should then pass the vector to the function in the header file that stores the data into the .txt file.

The function in the main that views the data should retrieve the data using the getData function in the header file and then parse each line from the vector using methods of the string class such as str.find() and str.substr(). It should output each line as it reads it. This function should have a void return type. The output should look like this:

Name: Vanna White

Age: 56

Thanks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!