Below is my code for C++, I keep getting an error
43 5 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-
mingw32\4.9.2\include\c++\bits\istream.tcc [Error] 'basic_istream' does not name a type
I had it running perfectly until I messed with the istream.tcc
PLEASE HELP
//This program holds, in an array of string objects, five student names.
//This program also uses an array of five characters to hold five students' letter grades
//and five arrays of four doubles to hold each student's set of test scores.
#include <iostream>
using namespace std;
const int NUM_TESTS = 4; // Number of tests
const int NUM_STUDENTS = 5; // Number of students
double inputValidate(double);
void getStudentTestScores(double[]);
double calculateAverageOfArray(const double[], int);
char getAverageLetterGrade(double);
void getStudentNames(string[]);
void getAllTestScores(const string[],
double[],
double[],
double[],
double[],
double[]);
void calculateAndDisplayAverages(const string[],
const double[],
const double[],
const double[],
const double[],
const double[]);
int main()
{
string studentNames[NUM_STUDENTS];
double student1TestScores[NUM_TESTS];
double student2TestScores[NUM_TESTS];
double student3TestScores[NUM_TESTS];
double student4TestScores[NUM_TESTS];
double student5TestScores[NUM_TESTS];
getStudentNames(studentNames); //User input student names
getAllTestScores(studentNames, //User input student test scores
student1TestScores,
student2TestScores,
student3TestScores,
student4TestScores,
student5TestScores);
calculateAndDisplayAverages(studentNames,
student1TestScores,
student2TestScores,
student3TestScores,
student4TestScores,
student5TestScores);
return 0;
}
void getStudentNames(string studentNames[])
{
cout << "Enter Student Names: " << endl;
for(int i = 0; i < NUM_STUDENTS; i++)
{
cout << "Student " << (i + 1) << " Name: ";
getline(cin, studentNames[i]);
}
}
void getAllTestScores(const string studentNames[],
double student1TestScores[],
double student2TestScores[],
double student3TestScores[],
double student4TestScores[],
double student5TestScores[])
{
cout << "\nEnter test scores for " << studentNames[0] << endl;
getStudentTestScores(student1TestScores);
cout << "\nEnter test scores for " << studentNames[1] << endl;
getStudentTestScores(student2TestScores);
cout << "\nEnter test scores for " << studentNames[2] << endl;
getStudentTestScores(student3TestScores);
cout << "\nEnter test scores for " << studentNames[3] << endl;
getStudentTestScores(student4TestScores);
cout << "\nEnter test scores for " << studentNames[4] << endl;
getStudentTestScores(student5TestScores);
}
void getStudentTestScores(double array[])
{
for (int i = 0; i < NUM_TESTS; i++)
{
cout << "Test Number" << (i + 1) << ": ";
array[i] = inputValidate(array[i]);
}
}
double inputValidate(double number)
{
while(!(cin >> number) || (number < 0 || number > 100))
{
cout << "Error. A number from 0 - 100 must be entered: ";
cin.clear();
}
return number;
}
void calculateAndDisplayAverages(const s.
Below is my code for C++- I keep getting an error 43 5 C--Progr.pdf
1. Below is my code for C++, I keep getting an error
43 5 C:Program Files (x86)Dev-CppMinGW64libgccx86_64-w64-
mingw324.9.2includec++bitsistream.tcc [Error] 'basic_istream' does not name a type
I had it running perfectly until I messed with the istream.tcc
PLEASE HELP
//This program holds, in an array of string objects, five student names.
//This program also uses an array of five characters to hold five students' letter grades
//and five arrays of four doubles to hold each student's set of test scores.
#include <iostream>
using namespace std;
const int NUM_TESTS = 4; // Number of tests
const int NUM_STUDENTS = 5; // Number of students
double inputValidate(double);
void getStudentTestScores(double[]);
double calculateAverageOfArray(const double[], int);
char getAverageLetterGrade(double);
void getStudentNames(string[]);
void getAllTestScores(const string[],
double[],
double[],
double[],
double[],
double[]);
void calculateAndDisplayAverages(const string[],
6. average = calculateAverageOfArray(student3TestScores, NUM_TESTS);
cout << "Average test score for " << studentNames[2] << " = " << average << endl;
average_letter_grade = getAverageLetterGrade(average);
cout << "Letter grade = " << average_letter_grade << endl;
cout << endl;
// Student number 4
average = calculateAverageOfArray(student4TestScores, NUM_TESTS);
cout << "Average test score for " << studentNames[3] << " = " << average << endl;
average_letter_grade = getAverageLetterGrade(average);
cout << "Letter grade = " << average_letter_grade << endl;
cout << endl;
// Student number 5
average = calculateAverageOfArray(student5TestScores, NUM_TESTS);
cout << "Average test score for " << studentNames[4] << " = " << average << endl;
average_letter_grade = getAverageLetterGrade(average);
cout << "Letter grade = " << average_letter_grade << endl;
cout << endl;
}
double calculateAverageOfArray(const double array[], int ARRAY_SIZE)
{
double sum = 0;
for (int i = 0; i < ARRAY_SIZE; i++)
sum += array[i];
7. return sum / ARRAY_SIZE;
}
char getAverageLetterGrade(double average)
{
char letter;
if (average <= 100 && average >= 90)
letter = 'A';
else if (average < 90 && average >= 80)
letter = 'B';
else if (average < 80 && average >= 70)
letter = 'C';
else if (average < 70 && average >= 60)
letter = 'D';
else if (average < 60 && average >= 0)
letter = 'F';
return letter;
}
begin{tabular}{l|l|l|l} Line & Col & File & Message 879 & 0 & C:Program Files (x86)Dev-
CppMinGW64Yliblgcclx8... & In file included from C:/Program Files (x86)/Dev-
Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/istream end{tabular}