This program passes two parallel arrays ta a function that prints the grade reports i.e Jay Rino -- Grade: A, I had coded this program as per my knowledge but it does not executed well please help me solve this. I know there is no user input needed but I dont know how to pass that using arrays & functions, please help me.
// StudentGrades.cpp - This program assigns a letter grade to a student.
// Input: None
// Output: Student name and grade
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
// Write function declaration here
int main(int argc, char *argv[])
{
const int size=10;
double Grades;
double grades[size] = {76, 65, 59, 98, 92, 88, 76, 54, 93, 78};
string students[size] = {"Ray Evans", "Sonia Bell", "Tim Egan", "Karen Davis", "Dan Peters", "Jean Janson", "Ellen Thomas", "Susan Swanson", "Ellie Rodriguez", "Gupta Patel"};
int x=0;
cout << "Enter grade ---> ";
cin >> Grades;
while ( x < 11)
{
if (Grades < 60)
{
cout << "F ---> "<<students[x];
}
else if ( Grades >=60 || Grades <= 69)
{
cout << "D ----> " <<students[x];
}
else if (Grades >= 70 || Grades <= 79)
{
cout << "C ---> " <<students [x];
}
else if ( Grades >= 80 || Grades <= 89)
{
cout << "B ---> "<<students [x];
}
else if (Grades >= 90 || Grades <= 99)
{
cout << "A ---> "<<students [x];
}
x = x + 1;
}
// Call calculateGrades function here
system("PAUSE");
return EXIT_SUCCESS;
} // End of main() function
// Write calculateGrades function here