Question: C++ homework. Moderate length: will rate from multiple accounts! You have my word! Problem 2 Overview: In this question you will write a program that

C++ homework. Moderate length: will rate from multiple accounts! You have my word!C++ homework. Moderate length: will rate from multiple accounts! You have myword! Problem 2 Overview: In this question you will write a program

Problem 2 Overview: In this question you will write a program that reads a.csv file with up to 100 lines and stores the information in an array of structs and also writes the lines whose gpa is greater than a minimum value to a output .csv file. Each line of the input file corresponds to a struct element in the array. Then you will allow the user to print the contents of the array Specifics 1. Your program should handle up to three command line arguments: the name of a .csv file to read, name of the output.csv file and a minimum gpa Input and output files need to be stored in the same directory as your program a. b. You can use the file named "data.csv as an input file, on Moodle, or create your own if you prefer Each line in the files must follow the format ",,AGE." C. 2. Create an array that holds the User struct objects. Use the following struct declaration CSCI 2270 -Data Structures Instructors: Shayon Gupta, Ashutosh Trivedi, Maciej Zagrodzki Assignment 1, January 2019 struct User f string username float gpa; int age; l; 3. Reading from the input file, "data.csv a. Each line of the file can be read using getline function b. Parse each line using stringstream and convert each entry into its appropriate data type. USERNAME should be a string, GPA should be a float, and AGE should be an int. (Hint: Use stoi, stof functions to convert from strings to numbers) 4. Writing into a file a. Write the ,GPA>, is more than the minimum gpa (read as a command line argument) into a csv file 5. Write a function named addUser to perform the following operations 5. Write a function named addUser to perform the following operations: The addUser function has the following signature // length: Number of items currently stored in the array Void addUser(User users[], string_username, float_gpa, int _age, int length); a. b. Instantiate a struct and store the USERNAME, GPA, AGE values in it c. Add the struct to the users array 6. Write a function named printList to perform the following operations: a. printList function has the following signature // length: Number of items in the array void printList(const User usersl], int length); b. Loop through the populated array Print out each element of the list in the following format c. USERNAME> KGPA>] age: AGusing the below cout statement CSCI 2270 -Data Structures Instructors: Shayon Gupta, Ashutosh Trivedi, Maciej Zagrodzki Assignment 1, January 2019 std..cout

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!