Answer to Question #32260 in C++ for ghelo

Question #32260
hi i need a help, how to create a program that will compute the average grade of the student with 3 inputted quizes. they didn't teach us the input/utput.
1
Expert's answer
2013-06-24T11:52:57-0400
#include <iostream>
#include <conio.h>

using namespace std;
//mina function
int main()
{
int arrayofgrade[3];
//input number
for(int i=0;i<3;i++){
cout<<"Enter quiz "<<(i+1)<<": ";
cin>>arrayofgrade[i];
}
//declare variable
float sum=0;
float average=0;
//fin sum
for(int i=0;i<3;i++){
sum+=arrayofgrade[i];
}
//calculate average
average=sum/3;
//show Average
cout<<"
Average is: "<<average;
getch();//delay
return 0;
}

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
APPROVED BY CLIENTS