0
Write a program that promods the user to enter 5 test score and then print the average test score.
Could you please help me do this question
9 Respostas
+ 5
nora_d Yeah .float is the datatype used to indicate decimal numbers.
For big decimal nos u can use double as well. But in this case float is sufficient and ur program is correct i think so.
+ 7
We are happy to help u with ur codes(which u was supposed to write in the description).
But there's noone here to write the entire code for u..
Hope u understand..
Also pls tag the language in which u wanna code..
+ 6
I think stmt of average calculation must end with a semicolon.
ie, double average=...blabla;
Then it'll work fine.
+ 2
Sure I'll write it down
+ 2
Ohh I seeeee
Thank u so much ✨ 😄
+ 1
I'm sorry I didn't know 🙏
+ 1
C++
+ 1
Ohhhh okay thank uu
It also said in the question ( Assume that the test scores are decimal numbers )
Will it be the same as long as I did put the float
0
#include <iostream>
using namespace std;
int main()
{
float a , b, c,d,e;
cout<< "Enter first test score :";
cin >> a;
cout<< "Enter second test score :";
cin >> b;
cout<< "Enter third test score :";
cin >> c;
cout<< "Enter the fourth test score :";
cin >> d;
cout<< "Enter the fifth test score :";
cin >> e;
double average =( a+b+c+d+e )/5
cout << " your average score is :" << average<< endl;
return 0;
}