Write a ‘C++’ program (capable of being compiled on any standard ‘C++’ compiler and
in particular Bloodshed Dev-C++ compiler, the one that we use for our course.
The program will need to calculate the final mark and corresponding grade and letter
grade based on the information given below.
int main()
{
int grade;
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