Question: How do you apply the following with the below code? The code will need to ask the user for their selection of what they want

How do you apply the following with the below code?

The code will need to ask the user for their selection of what they want to do. Give them a choice of at least the following (Perform the above over and over until the user wants to quit): 1. Load from a file a. Read in an existing favorite activities and store it into your array of structures 2. Add a new item to the list a. Read in information from the user for something to add to the list. b. Append this information to the external data file 3. Search for a matching activity by its name to display all of the information about that activity 4. Display all 5. Quit

Here is the code:

#include using namespace std;

//structure struct Activity { string name,location,year,description,attire,certainDates; };

int main() { int size,i; cout<<"Enter number of activities: "; cin>>size;

//array of structure Activity act[size]; //accepting all the values of activities from user for(i=0;i>act[i].name; cout<<"Enter Where activity is located: "; cin>>act[i].location; cout<<"Enter time of year: "; cin>>act[i].year; cin.ignore(); cout<<"Enter description: "; getline(cin,act[i].description); cout<<"Enter special attire: "; cin>>act[i].attire; cin.ignore(); cout<<"Enter available for certain dates(separated by comma): "; getline(cin,act[i].certainDates); }

//displaying the activities with details for(i=0;i

return 0; }

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!