hello everyone, I'm a bit stuck right now.
i don't know exactly how to start , store and calculate the data from a file. this is what i have right now:
int main()
{
string data ;
ifstream myfile ("student_data.txt");
int students[16] = {} ;
const int array_size = 16;
int student[array_size];
int i = 0 ;
Okay, you look like you're getting the student id out of each record read (data).
Now, you need to read the assignments for each student.
You can do this one of two ways.
1) You can create a two dimensional array.
int assignments[array_size][11];
2) The better approach would be to create a struct that represents a student (if you've covered structs):
1 2 3 4 5 6 7 8 9 10
struct student
{ int student_id;
int assignments[11];
int midterm;
int final;
int pct;
string grade;
};
student[array_size] students;
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.