The program will need to calculate the final mark and corresponding grade and letter
grade based on the information given below.
• The final mark is derived from the following components of the assessments.
• Result calculation is based on information below:
o Exam (50%)
o Coursework (50%) components are made up of the total from the mid term test
(20%), programming assignment (15%) and lab practice (15%).
▪ Courseworks = Mid term test * 0.20 + Lab Practices (total marks /
150) * 0.15 + Programming Assignment * 0.15
▪ Final Mark = Exam * 0.5 + Courseworks
• Your program should also display the letter and letter grade based on the table
below:
Table A: Grade
MARKS
GRADE
Letter
Grade
Percentage
75 to 100
Distinction
A
80 - 100
A-
75 - 79Page 4
60 to 74
Credit
B+
70 - 74
B
65 - 69
B-
60 - 64
50 to 59
Pass
C+
55 - 59
C
50 - 54
0 to 49
Fail
C-
45 - 49
D
40 - 44
F
0 - 39
int main()
{
double totalmark;
double exam;
double midtermtest;
double program;
double labpract;
double courseworks;
int finalmark;
cin >> totalmark;
cin >> exam;
cin >> program;
cin >> midtermtest;
labpract = totalmark / 150;
courseworks = midtermtest * 0.20 + labpract * 0.15 + program * 0.15;
finalmark = exam * 0.5 + courseworks;
cout << "Grade" << endl;
cout << "Percentage" << endl;
cout << finalmark << endl;
if (finalmark >= 0 && finalmark < 40)
{
cout << "F" << endl;
}
else if (finalmark >= 40 && finalmark <= 44)
{
cout << "D" << endl;
}
else if (finalmark >= 45 && finalmark <= 49)
{
cout << "C-" << endl;
}
else if (finalmark >= 50 && finalmark <= 54)
{
cout << "C" << endl;
}
else if (finalmark >= 55 && finalmark <= 59)
{
cout << "C+" << endl;
}
else if (finalmark >= 60 && finalmark <= 64)
{
cout << "B-" << endl;
}
else if (finalmark >= 65 && finalmark <= 69)
{
cout << "B" << endl;
}
else if (finalmark >= 70 && finalmark <= 74)
{
cout << "B+" << endl;
}
else if (finalmark >= 75 && finalmark <= 79)
{
cout << "A-" << endl;
}
else if (finalmark >= 80 && finalmark < 101)
{
cout << "A" << endl;
}
else
{
cout << "Error" << endl;
}
}
Comments
Leave a comment