Solution to Write a c++ program to compute the results of five HND 1 students taking all … - Sikademy
Author Image

Archangel Macsika

Write a c++ program to compute the results of five HND 1 students taking all the first semester courses displaying their number,course title and grades.

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question

using namespace std;



#define NO_OF_STUDENTS 3

#define NO_OF_SUBJECTS 5



int main()

{

 int Marks[NO_OF_STUDENTS][NO_OF_SUBJECTS+1];

 int r,c,a,b;

 for(r=0;r<NO_OF_STUDENTS;r++)

 {

  for(c=0;c<NO_OF_SUBJECTS+1;c++)

  {

   Marks[r][c]] = 0;

  }

 }



 for(r=0;r<NO_OF_STUDENTS;r++)

 {

  for(c=0;c<NO_OF_SUBJECTS;c++)

  {

   cout<<"\nEnter Student-"<<r+1<<": Subject-"<<c+1<<" Marks: "; cin>>Marks[r][c];

   Marks[r][c] = Marks[r][c]+Marks[r][c];

  }

 }

 for(r=0;r<NO_OF_STUDENTS;r++)

 {

  Marks[r][NO_OF_SUBJECTS] = Marks[r][NO_OF_SUBJECTS]/NO_OF_SUBJECTS;

  if(Marks[r][NO_OF_SUBJECTS]<50) cout<<"\n\tStudent-"<<r+1<<" Grade-D";

  if(Marks[r][NO_OF_SUBJECTS]>=50 && Marks[r][NO_OF_SUBJECTS]<60) cout<<"\n\tStudent-"<<r+1<<" Grade-C";

  if(Marks[r][NO_OF_SUBJECTS]>=60 && Marks[r][NO_OF_SUBJECTS]<80) cout<<"\n\tStudent-"<<r+1<<" Grade-B";

  if(Marks[r][NO_OF_SUBJECTS]>=50) cout<<"\n\tStudent-"<<r+1<<" Grade-A";

 }

 return(0); 

}

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1006-qpid-3