Write a program that takes as input the marks of three tests and computes the total and average marks of the student. The program should also display 'SELECTED FOR NASA TRIP' if the total marks exceeds 250 and 'BETTER LUCK NEXT TIME'
#include <iostream>
using namespace std;
int main()
{
float test1, test2, test3;
cout << "Please, enter marks for the first test: ";
cin >> test1;
cout << "Please, enter marks for the second test: ";
cin >> test2;
cout << "Please, enter marks for the third test: ";
cin >> test3;
float total = test1 + test2 + test3;
cout << "The total marks of the student is "
<< total <<endl;
cout << "The average marks of the student is "
<< total/3<<endl;
if (total > 250)
cout << "SELECTED FOR NASA TRIP";
else
cout << "BETTER LUCK NEXT TIME";
}
Comments
Leave a comment