Need help with C++ program please I\'ve attempted this program but i get an erro
ID: 3938459 • Letter: N
Question
Need help with C++ program please
I've attempted this program but i get an error (too many errors in functions)
#include <iostream>
#include <fstream>
using namespace std;
void inputscores();
main()
{
int id[5];
int testscore[5][4];
float avgone[5];
float avgtwo[5];
float gradeavg[5] = {'A','B','C','D','F'};
float gradeweighted[5] = {'A','B','C','D','F'};
inputscores(testscore,id);
}
void inputscores(int t[5][4], int ID[5])
{
for(int i = 0; i < MAXROWS; i++)
{
for(int k = 0; k < MAXCOL; k++)
{
cout <<"Type in grade" << "#" << k+1 << endl;
cin >> t[i][k];
}
}
}
Explanation / Answer
Here is the modification, after correcting all the errors.
#include <iostream>
#include <fstream>
using namespace std;
void inputscores(int t[][4], int id[]);
#define MAXROWS 5
#define MAXCOL 4
int main()
{
int id[5];
int testscore[5][4];
float avgone[5];
float avgtwo[5];
float gradeavg[5] = {'A','B','C','D','F'};
float gradeweighted[5] = {'A','B','C','D','F'};
inputscores(testscore,id);
}
void inputscores(int t[5][4], int ID[5])
{
for(int i = 0; i < MAXROWS; i++)
{
for(int k = 0; k < MAXCOL; k++)
{
cout <<"Type in grade" << "#" << k+1 << endl;
cin >> t[i][k];
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.