Your client wishes to have a program that would generate a student database in a form of Excel spreadsheet. In order to save a record to the spreadsheet, client will enter student data at the prompt, one record at a time.Every record in the database is represented by student data; record number, first name, last name, ID, GPA. Your assignment is to write the program that would get user input, one line at the time, and write them to a Comma Separated Values file. In addition, the program will need to save student record as a single string to a vector of strings, one record at a time. When user is done entering records, program should display all the lines entered by the user to the screen. Things to consider when implementing the program: 1.write_file(vector &v): (1)Open file for writing (2)check if file can be open for writing (due to memory problems) (3)Prompt user to enter student records. NOTE: number of records is unknown, so program must repeatedly prompt user for input until the user enters “quit”. To make this work, extract only the first word from standard input stream buffer (this would be the student’s last name) and check it is “quit”. (4)Extract the rest of the values from standard input stream: first name, student id, and gpa. (5)use DO-WHILE loop to get user input (6)use output string stream to write to the CSV file (7)NOTE: you should also insert record number to before the student record (figure out how to do that). (8)Add student record to the vector passed in by reference (meaning that the function will modify the original vector) (9)close filewhen user enters “quit” 2.print_student_info(vector &v) 3.main( )Main function should integrate both the helper functions described above to solve the given problem.NO GLOBAL variables, all variables should be local. Main should print program title, call write_file( ) and print_student_info( ) functions, and print content of the vector to the console. At the end, program should remind user to check student_database.csv file by opening it with Microsoft Excel With this assignment, can you write it in C++ and can you also include string streams as well?
Your client wishes to have a
Things to consider when implementing the program:
1.write_file(vector<string> &v):
(1)Open file for writing
(2)check if file can be open for writing (due to memory problems)
(3)Prompt user to enter student records. NOTE: number of records is unknown, so program must repeatedly prompt user for input until the user enters “quit”. To make this work, extract only the first word from standard input stream buffer (this would be the student’s last name) and check it is “quit”.
(4)Extract the rest of the values from standard input stream: first name, student id, and gpa.
(5)use DO-WHILE loop to get user input
(6)use output string stream to write to the CSV file
(7)NOTE: you should also insert record number to before the student record (figure out how to do that).
(8)Add student record to the vector passed in by reference (meaning that the function will modify the original vector)
(9)close filewhen user enters “quit”
2.print_student_info(vector<string> &v)
3.main( )Main function should integrate both the helper functions described above to solve the given problem.NO GLOBAL variables, all variables should be local. Main should print program title, call write_file( ) and print_student_info( ) functions, and print content of the vector to the console. At the end, program should remind user to check student_database.csv file by opening it with Microsoft Excel
With this assignment, can you write it in C++ and can you also include string streams as well?



The program is given below:-
Step by step
Solved in 2 steps with 2 images









