How can write program to calculate average provided that the grades smaller or equal to 100 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How can write program to calculate average provided that the grades smaller or equal to 100

1st Mar 2017, 4:48 PM
Bts...
Bts... - avatar
17 Answers
0
Will you write this program in c ++?
1st Mar 2017, 4:50 PM
Batuhan
Batuhan - avatar
0
I need help me in this program
1st Mar 2017, 5:05 PM
Bts...
Bts... - avatar
0
The only thing I don't know how to do, is to prepare for multiple inputs. But, you would add all the inputs, then divide them by the number of inputs.
1st Mar 2017, 5:09 PM
Sterling Richard
Sterling Richard - avatar
0
I can help you tell the full story of the program
1st Mar 2017, 5:11 PM
Batuhan
Batuhan - avatar
0
Let's say you have a set amount of tests. You have 10 tests and want to calculate the average. Set ten different variables as inputs. Then add all inputs then divide by ten.
1st Mar 2017, 5:12 PM
Sterling Richard
Sterling Richard - avatar
0
let's say you have 7 grades
1st Mar 2017, 5:13 PM
Bts...
Bts... - avatar
0
but how can do conditions of this problem
1st Mar 2017, 5:14 PM
Bts...
Bts... - avatar
0
int I; int a; int m; int e; int p; int b; int c;
1st Mar 2017, 5:16 PM
Bts...
Bts... - avatar
0
float average;
1st Mar 2017, 5:16 PM
Bts...
Bts... - avatar
0
Sung, Add all the variables together in a new int called "sum" Now make float average = sum/7
1st Mar 2017, 5:19 PM
Sterling Richard
Sterling Richard - avatar
0
how can make condition? by use if or switch
1st Mar 2017, 5:19 PM
Bts...
Bts... - avatar
0
if (int l, int e, so on so fourth > 100) Print "Please enter a test grade lower than 100."; Return; Else Print average
1st Mar 2017, 5:20 PM
Sterling Richard
Sterling Richard - avatar
0
so I say sum=(i+a+m+e+p+b+c);
1st Mar 2017, 5:22 PM
Bts...
Bts... - avatar
0
Yes then make average = sum/7
1st Mar 2017, 5:22 PM
Sterling Richard
Sterling Richard - avatar
0
#include <iostream> using namespace std; int main() { int fexam, sexam, texam, avg; cout << "Enter the first exam grade: "; cin >> fexam; cout << "Enter the second exam grade: "; cin >> sexam; cout << "Enter the third exam grade: "; cin >> texam; avg= (fexam+sexam+texam)/3; if (avg >=0 && avg<=45) cout <<"You did not pass the class successfully"; else if (avg >=46 && avg<=69) cout << "You need to work a little more"; else if (avg >=70 && avg<=84) cout << "You can be a successful student with a little more effort."; else if (avg >=85 && avg <=100) cout << "Congratulations, you passed the class with success."; return 0; }
1st Mar 2017, 5:23 PM
Batuhan
Batuhan - avatar
0
Maybe it might not work, but you can create something like this.
1st Mar 2017, 5:23 PM
Batuhan
Batuhan - avatar
0
OK thank you
1st Mar 2017, 6:04 PM
Bts...
Bts... - avatar