Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include using namespace std; double average(int grade[], int a) { int sum=0, b; for(b=0; b

#include

using namespace std;

double average(int grade[], int a)

{

int sum=0, b;

for(b=0; b

{

sum=sum+grade[b];

}

return (sum/a);

}

int highest(int grade[], int a)

{

int grt=grade[0], i;

for(i=0; i

{

if(grt

grt=grade[i];

}

return grt;

}

void pass(int grade[], char name[], int a, double ave)

{

cout<<"Students who pass are : "<

for(int k=0; k

{

if(grade[k]>ave)

cout<

}

}

int main()

{

char name[]={0};

int grade[]={0}, a=0, sum=0, l=0, size=0;

cout<<"Enter 00 to stop entering values"<

cout<<"Enter initial and grade : "<

while(1)

{

cin>>name[a];" ";

if(name[a]=='0')

break;

cin>>grade[a];

a++;

}

int high=highest(grade, a);

double ave=average(grade, a);

cout<<"Highest grade is "<

cout<

pass(grade, name, a, ave);

return 0;

}

//This is my code to find the largest and average of test grades entered. I also have to output the initials of the students whose grades are above average. Why is the program not outputting those initials and how do i fix it?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago