Create C++ full program that enables a lecturer to enter marks of student, the
lecture should add marks for Test 1, Test 2 and Test3, then the program should:
✓ Calculate the average of the test,
✓ Show whether the student qualify for exam or not,
✓ It must also shows qualified with a distinction if above 75.
Source code
#include <iostream>
using namespace std;
int main()
{
int test1,test2,test3;
double average;
cout<<"\nEnter score for test 1: ";
cin>>test1;
cout<<"\nEnter score for test 2: ";
cin>>test2;
cout<<"\nEnter score for test 3: ";
cin>>test3;
average=(test1+test2+test3)/3.0;
cout<<"\nAverage = "<<average;
if (average>75)
cout<<"\nThe student is qualified for exam.";
else
cout<<"\nThe student is NOT qualified for exam.";
return 0;
}
Sample Output
Comments
Leave a comment