Develop a data dictionary and a flowchart, that will accept 10 students details such Student Name, ID No. and Marks of three subjects (All marks entered by the user must be within the range of 0 -100). Calculate the average marks for the student and the average marks will determine the final grade of the student. The assessment will be as follow:
70 –100 : A
60 –69 : B
50 –59 : C
40 – 49 : D
0 –39 : F
Here is program:
int main()
{
const int size = 3;
int grade;
string name;
int id;
string arr[size];
for (int j = 0; j < 10; j++)
{
cout << "Enter name student:" << endl;
cin >> name;
id++;
for (int i = 0; i < size; i++)
{
cin >> grade;
if (grade > 0 && grade < 40)
{
arr[i] = "F";
}
else if (grade >= 40 && grade < 50)
{
arr[i] = "D";
}
else if (grade >= 50 && grade < 60)
{
arr[i] = "C";
}
else if (grade >= 60 && grade < 70)
{
arr[i] = "B";
}
else if (grade >= 70 && grade < 101)
{
arr[i] = "A";
}
else
{
cout << "Error" << endl;
break;
}
}
}
}
Comments
Leave a comment