Need help with calculating student grades using arrays.
If I have the names and subsequent grades listed on notepad input file.
eg.
Name1 23 43 54 23 43 54
Name2 54 34 65 76 23 54
Name3 97 68 45 68 86 58
How do I setup two dimensional array using for loops and while loops so it would get the total of all the grades.
In addition, say the first 3 are programs and the last 3 are the test grades, how do I get it to add the first 3 to give me the program avg and last 3 to give me test avg?
I have done the following so far.. if someone can please help me on where to begin.
#include<iostream>
#include<iomanip>
#include<fstream>
#include<conio.h>
using namespace std;
ifstream fin;
int main(){
system("color f0");
fin.open("input.txt");
if (!fin){
cout<<"Input failure"<<endl;
system("pause");
return 1;
}
string names [3][2];
int scores [3][6];
float progavg[3], testavg[3], courseavg[3], total[3];