Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help on reading this csv file properly in C++. My function reads the the first line but breaks afterwards. Please help!! My header

I need help on reading this csv file properly in C++. My function reads the the first line but breaks afterwards. Please help!!

My header file and cpp file.

image text in transcribed

My output:

image text in transcribed

What the output should look like(the csv file).

image text in transcribed

#include #include #include #include void readCsvToArray(Student array[], int size, ifstream& file) 7 string dummyString; getline(file, dummyString); 10 using namespace std; struct Student 11 int index = 0; char delim = ','; while (!file.eof() && index > array[index].id >> delim; int id; string lastName; string firstName; string ssn; float test[4]; float final; string letterGrade; char delim = ', '; getline(file, array[index].lastName, , getline(file, array[index].firstName, ...); file >> array[index].ssn >> delim; file >> array[index].test[4] >> delim; file >> array[index].final >> delim; getline(file, array[index].letterGrade, .,; 24 25 void menu(); void readCsvToArray(Student array[], int size, ifstream& file); #endif cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions