Compute Average of Two Scores

Describe an algorithm to compute the average of two scores obtained by each of the 100 students

Questions by lakumi

Showing Answers 1 - 6 of 6 Answers


Lets assume an array called Array, of type Student.
Each student contains 3 data members. they are:

String name;
int scoreOne;
int scoreTwo;

for(int i = 0; i < Array.length; i++){
    int sum   = Array[i].scoreOne = Array[i].scoreTwo;
    int result = (sum / 2);
    print Array[i].name + " AVG = " +   result + "n";
}


  Was this answer useful?  Yes

struct student
{
int scoreone;
int scoretwo;
};

student st[10];

void average()
{
int result,sum;
 for(int count=0; count < 10; count++)
 {
   sum = st[i].scoreone + st[i].scoretwo;
   result = sum/2;
 }
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions