Question: I must write a C++ console program that prompts a user to enter attributes for three students and output the data in a formatted table.

I must write a C++ console program that prompts a user to enter attributes for three students and output the data in a formatted table.

To do so, I must write a value-returning function that will collect the data from the user for 1 student and store it in a struct, and that will be called three different times from the main function (one for each student).

The struct must look like this:

struct Student

{

string name;

int id;

string address;

string major;

double gpa;

};

I am having trouble with the function, I am trying to pass the struct to the function by reference but can't for all three students. I need to have a function that will get all the info for the first student and store it in a struct, then call the function again for the second student and same for the third student. The data for all three students must be output in a formatted table

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!