Solution to Write a program that takes as input the marks of three tests and computes the … - Sikademy
Author Image

Archangel Macsika

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'

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


#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"; }

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1037-qpid-33