This was a past assignment (it was last week's assignment), but I couldn't complete it. Could anyone help me finish it? I'm new to the function calls. The professor said I didn't call them from main properly. Although I've already received a grade on this assignment, we now have a chance to get extra credit on the same type of assignment. I need to learn this so if anyone can help me with it, I would greatly appreciate it.
#include <iostream>
#include <iomanip>
using namespace std;
int getExam1Scores(int, float);
int getExam2Scores(int, float);
void averageGrades(float[], int, float[]);
float Exam1Grade;
float Exam2Grade;
float AverageGrade;
float calculateAverage;
float GradeAverage;
float AvgExam2Grade;
float AvgExam1Grade;
int rows;
int cols;
void display(int);
int main ()
{
const int NUM_ROWS = 10;
const int NUM_COLS = 4;
double NumStudents[NUM_ROWS][NUM_COLS]; //Array with 10 rows and 4 columns
cout << "This program will allow the user to input " << endl;
cout << "2 exam scores for 10 students and those scores " << endl;
cout << "will be averaged. The results will be " << endl;
cout << "diplayed in a two-dimensional array." << endl;
//Nested loops to fill array with students information.
}
int getExam1Scores (int count, float Grade)
{
for (rows = 0; rows < Num_Rows; rows++)
{
for (cols = 1; cols < 2; cols++)
(
cout << "Enter exam 1 grade for student " << rows+1 << ": ";
cin >> NumStudents[rows][cols];
Grade++;
}
cout << endl;
return 0;
}
int getExam2Scores (int count, float Grade)
{
cout << endl;
for (rows = 0; rows < Num_Rows; rows++)
{
for (cols = 2; cols < 3; cols++)
(
cout "Enter exam 2 grade for student " << student+1 << ": ";
cin >> NumStudents[rows][cols];
Grade++;
}
cout << endl;
return 0;
}
void calculateAverage
{
for (rows = 0; rows < Num_Rows; rows++)
{
for (cols = 3; cols <=3; cols++)
{
GradeAverage = ((Exam1Grade + Exam2Grade)/2);
}
}
void display (int count)
{
float TotalExam1Grade=0;
float TotalExam2Grade=0.0, TotalAverage=0.0;
float AvgExam1Grade, AvgExam2Grad, AvgAverage;
cout << "\n\nSTUDENT" << "\t" << "Exam 2 " << "\t" << "Exam 3 " << "\t" << "Exam Average" << endl;
for (int student = 0; student < count; student++)
{
cout << student+1 << "\t" << Exam1Grade[student] << "\t\t" << Exam2Grade[student] << "\t\t"<<
GradeAverage(student) << "\t\t" << endl;
TotalExam1Grade = TotalExam1Grade + Exam1Grade[student];
TotalExam2Grade = TotalExam2Grade + Exam2Grade[student];
TotalAverage = TotalAverage + GradeAverage[student];
}
cout << "\n\n Exam 1 Average :" << AvgExam1Grade;
cout << "\n Exam 2 Average :" << AvgExam2Grade;
cout << "\n Average for all students:" << AvgAverage;
}