Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In C++: Write a program that computes the exam statistics for a class of 10 stud

ID: 3803784 • Letter: I

Question

In C++:

Write a program that computes the exam statistics for a class of 10 students. You should use an array that stores exam scores for 10 students. The program will ask the user to enter scores for each student and when all the scores are entered, the program computes the average score, minimum score, maximum score, and should print all the scores entered by the user.

Constraint: You must use ‘for’ loop to read the score, compute average, min, max, and to print the scores.

You can use as many ‘for’ loops as you wish.

Input Validation: the exam score must be 1 <= score <= 100

Example:

Enter the exam scores.

Enter score for student 1: 40

Enter score for student 2: 88

.

.

.

Enter score for student 10: 91

EXAM STATISTICS:

Average Score: 78.67

Minimum Score: 10

Maximum Score: 91

Scores entered by the user

40, 88, … ,91

Explanation / Answer

#include<iostream.h>

#include<conio.h>

void main()

{

int a[10];

int n=11;

int b;

void Findmaxmin();

cout<<"enter the exam score"<<endl;

for( int i=1;i<n;i++)

{

cout<<"enter the score for student"<<i<<endl;

cin>>a[i];

}

cout<<"EXAM STATISTICS"<<endl;

for(int j=1;j<n;j++)

{

for(int k=2;k>j;k++)

{

b=a[j]+a[k];

}

}

cout<<"Average score :"<<b<<endl;

void Findminmax()

{

int max,min;

min=max=a[1];

for(int i=0;i<11;i++)

{

if(a[i]<min)

min=a[i];

else if(a[i]>max)

max=a[i];

}

cout<<"minimum score:"<<min<<endl;

cout<<"maximum score:"<<max<<endl;

}

cout<<Findmaxmin();

cout<<"scores entered by the user";

for( i=1;i<n;i++)

{

cout<<a[i]<<",";

}

}