Question: C++ Problem: 2. Read in a csv data file (filename comes in from command-line arguments) where each line is structured as such: username,gpa,age. Create a

C++ Problem:

C++ Problem: 2. Read in a csv data file (filename comes infrom command-line arguments) where each line is structured as such: "username,gpa,age". Create

2. Read in a csv data file (filename comes in from command-line arguments) where each line is structured as such: "username,gpa,age". Create a list as a vector that holds list structs. As you read in each line from the file, parse each value using stringstream and convert to the appropriate data type. Then call the addUser function to create the struct and store the values username, gpa, and age (string, float, int) into the struct. Add the struct to the vector. Back in the main function, call the printList function to loop through and print out the list formatted as: "username [gpa] age: #"eg., "elle [3.87] age: 12

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!