Answer to Question #278504 in C++ for Bushra

Question #278504

Write a program that can compute the average exam grade for multiple students.


• Each student has the same POLICY of exam grades -DEFINE Your own policy


• Prompt the user for the number of exams


• When you finish a student prompt the user to see if there are more students to process


1
Expert's answer
2021-12-11T10:00:48-0500
#include<iostream>
using namespace std;
int main(){
	int x;
	do{
			cout<<"Enter the number of exams:\n";
	int n ;
	cin>>n;
	int marks[n];
	int sum = 0;
	cout<<"Enter the marks for the student:\n";
	for(int i=0; i<n; i++){
		cin>>marks[i];
		sum += marks[i];
	}
	cout<<"The average is: "<<sum /n<<endl;
	cout<<"Are there more students to process:\n Enter 1 to continue else 2 to stop:\n";
	cin>>x;
	} while(x==1);


}

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