Hello,
I am new at C++ and I been learning how to use C++ a couple of weeks now and it hasn't given me any problems. However, I been working on this program for a days now and I can't figure out what the problem is so if somebody could please me I will really appreciate it. Please I need response quickly because tomorrow I need to turn this project in.
#include<iostream>
#include<iomanip>
using namespace std;
int getStudentCount()
{
int studentCount;
cout << "Enter the number of students: " << endl;
cin >> studentCount;
return studentCount;
}
void getExamScores(float examScores[], int studentCount)
{
int eScores;
cout << "Please enter the exam scores of the students" << endl;
for (eScores=0; eScores<studentCount; eScores++)
{
cin >> examScores[eScores];
cout << endl;
}
}
void getLabScores (float labScores [], int studentCount)
{
int lScores;
cout << "Please enter the Lab scores of the students" << endl;
for (lScores=0; lScores<studentCount; lScores++)
{
cin >> labScores[lScores];
cout << endl;
return;
}
}
void calculatePointGrades (float grades[], const float examScores[], const float labScores[], int nGrades, int studentCount)
{
int sum=0;
int grade=0;
int pointGrade=0;
for (sum= 0; sum<= studentCount; sum++)
{ sum= labScores[] + examScores[];
pointGrade= sum/2;
cin >> grades[grade];
cout << endl;
}
return;
}
void calculateLetterGrades (const float pointGrades [], char letterGrades[], int nStudents)
{
char A,B,C,D,F;
int grades;
pointGrades[grades];
showGradeData(examScores[eScores],labScores[lScores],pointGrades[grades],letterGrades[grades],studentCount); //Display results on Screen And calc averages
cout << "\n\n";
cin.ignore(2);
}
I get the following errors....
(44) : error C2059: syntax error : ']'
(78) : warning C4244: '=' : conversion from 'const float' to 'int', possible loss of data
(98) : error C2065: 'eScores' : undeclared identifier
(99) : error C2065: 'lScores' : undeclared identifier
(101) : error C2065: 'grades' : undeclared identifier
(101) : error C2660: 'calculatePointGrades' : function does not take 4 arguments
Errors:
44. sum= labScores[] + examScores[]; - What is this supposed to mean?
78. Not an error; you are just assigning a float to an int, meaning you lose the fractional part.
98. You are using the variable eScores, but I don't see one in that scope
99. See 98, for lScores
101. See 101, for grades
101. Your calculatePointGrades() function takes 5 arguments, and you are only passing 4