Answer to Question #304794 in C++ for Archit Arnav

Question #304794

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'

1
Expert's answer
2022-03-02T03:05:08-0500
#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";
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog