Question

CSC888 has 4 people. Each person needs to take 3 tests. Create a 4-by-3 two-dimensional array...

CSC888 has 4 people. Each person needs to take 3 tests. Create a 4-by-3 two-dimensional array to store the test scores. Ask the user to enter test scores one at a time to populate this array. Once the whole array is filled, do the following two things.

(1) For each student, display her test scores and the average of the three tests.

(2) For each test, display student scores and the average of the four students.

The following shows a test run of the program:

Enter test scores of student #1

Test #1: 95

Test #2: 92

Test #3: 88

Enter test scores of student #2

Test #1: 87

Test #2: 100

Test #3: 82

Enter test scores of student #3

Test #1: 76

Test #2: 74

Test #3: 81

Enter test scores of student #4

Test #1: 98

Test #2: 97

Test #3: 93

Student #1

Scores: 95 92 88

Average: 91.6666666666667

Student #2

Scores: 87 100 82

Average: 89.6666666666667

Student #3

Scores: 76 74 81

Average: 77

Student #4

Scores: 98 97 93

Average: 96

Test #1

Scores: 95 87 76 98

Average: 89

Test #2

Scores: 92 100 74 97

Average: 90.75

Test #3

Scores: 88 82 81 93

Average: 86

Press any key to continue . . .

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<stdio.h>
void main()
{
   int score[4][3], i,j;
   float avg;
   char a;
   do{
       for(i=0;i<4;i++)
       {
               printf("Enter test scores of student #%d\n",i+1);
               for(j=0;j<3;j++)
               {
                   printf("Test #%d ",j+1);
                   scanf("%d",&score[i][j]);
               }
       }
       for(i=0;i<4;i++)
       {
           avg=0;
           printf("Student #%d\n",i+1);
           printf("Scores: ");
           for(j=0;j<3;j++)
           {
               avg=avg+score[i][j];
               printf("%d ",score[i][j]);
           }
           printf("\n");
           printf("Average: %f\n",avg/3);
       }
       printf("Press any key to continue . . .",a);
       if((scanf("%c", a)) != '\n')
           break;
       else
           continue;
   }while(1);
}

Output:

Enter test scores of student #1                                                                                                              

Test #1 95                                                                                                                                   

Test #2 92                                                                                                                                   

Test #3 88                                                                                                                                   

Enter test scores of student #2                                                                                                              

Test #1 87                                                                                                                                   

Test #2 100

Test #3 82                                                                                                                                   

Enter test scores of student #3                                                                                                              

Test #1 76                                                                                                                                   

Test #2 74                                                                                                                                   

Test #3 81                                                                                                                                   

Enter test scores of student #4                                                                                                              

Test #1 98

Test #2 97                                                                                                                                   

Test #3 93                                                                                                                                   

Student #1                                                                                                                                   

Scores: 95 92 88                                                                                                                             

Average: 91.666664                                                                                                                           

Student #2     

Scores: 87 100 82                                                                                                                            

Average: 89.666664                                                                                                                           

Student #3                                                                                                                                   

Scores: 76 74 81                                                                                                                             

Average: 77.000000                                                                                                                           

Student #4       

Scores: 98 97 93                                                                                                                             

Average: 96.000000                                                                                                                           

Press any key to continue . . .

Add a comment
Know the answer?
Add Answer to:
CSC888 has 4 people. Each person needs to take 3 tests. Create a 4-by-3 two-dimensional array...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++: Create a grade book program that includes a class of up to 20 students each...

    C++: Create a grade book program that includes a class of up to 20 students each with 5 test grades (4 tests plus a Final). The sample gradebook input file (CSCI1306.txt) is attached. The students’ grades should be kept in an array. Once all students and their test scores are read in, calculate each student’s average (4 tests plus Final counts double) and letter grade for the class. The output of this program is a tabular grade report that is...

  • 5. Mark’s class just took the admission test for business school and averaged 87.05. Chapter 10...

    5. Mark’s class just took the admission test for business school and averaged 87.05. Chapter 10 Data Set 2 contains the population of scores for the 10 other classes in Mark’s university. How did Mark’s class do? Class 1 Class 2 Class 3 Class 4 Class 5 Class 6 Class 7 Class 8 Class 9 Class 10 78 81 96 85 88 78 90 79 96 86 77 78 97 90 88 82 86 93 87 89 78 93 88...

  • PLEASE SHOW ME HOW TO DO THIS.... For the Excel Data Set please find and report...

    PLEASE SHOW ME HOW TO DO THIS.... For the Excel Data Set please find and report for Test 1 and Test 2 the Mean, SD, and the tolerance levels for both for which there would be any outliers (i.e., the value for which a score must be less than to be consider an outlier and the value for which a number must greater than to be considered an outlier. See picture Performance Data Group 1 1 1 1 Test 2...

  • Midterm1 = (83.33, 98.33, 75, 91.67, 96.67, 95, 86.67, 65, 100, 100, 80, 88.33, 96.67, 96.67,...

    Midterm1 = (83.33, 98.33, 75, 91.67, 96.67, 95, 86.67, 65, 100, 100, 80, 88.33, 96.67, 96.67, 90, 96.67, 86.67, 93.33, 80, 91.67, 98.33, 86.67, 85, 86.67, 95, 83.33, 96.67, 81.67, 98.33, 100, 95, 93.33, 91.67, 88.33, 98.33, 93.33, 98.33, 93.33, 85, 88.33, 100, 98.33, 96.67, 90, 86.67, 100, 96.67, 98.33, 90, 96.67, 86.67, 95, 78.33, 86.67, 100, 81.67, 96.67, 91.67, 96.67, 96.67, 95, 96.67, 73.33, 100, 93.33, 96.67, 88.33, 70, 96.67, 96.67, 100, 88.33, 96.67, 100, 88.33, 100, 78.33, 93.33,...

  • Find the indicated measure. The test scores of 40 students are listed below. Find P85.

    Find the indicated measure. The test scores of 40 students are listed below. Find P85. 30 35 43 44 47 48 54 55 56 57 59 62 63 65 66 68 69 69 71 72 72 73 74 76 77 77 78 79 80 81 81 82 83 85 89 92 93 94 97 98  1) 85  2) 87 3) 89 4) 34

  • Find the indicated measure. The test scores of 40 students are listed below. Find P85. 30...

    Find the indicated measure. The test scores of 40 students are listed below. Find P85. 30 35 43 44 47 48 54 55 56 57 59 62 63 65 66 68 69 69 71 72 72 73 74 76 77 77 78 79 80 81 81 82 83 85 89 92 93 94 97 98 1) 85 2) 87 3) 89 4) 34

  • Consider the below matrixA, which you can copy and paste directly into Matlab.

    Problem #1: Consider the below matrix A, which you can copy and paste directly into Matlab. The matrix contains 3 columns. The first column consists of Test #1 marks, the second column is Test # 2 marks, and the third column is final exam marks for a large linear algebra course. Each row represents a particular student.A = [36 45 75 81 59 73 77 73 73 65 72 78 65 55 83 73 57 78 84 31 60 83...

  • Use the Grouped Distribution method for the following exercise (see Self-Test 2-4 for detailed instructions), rounding...

    Use the Grouped Distribution method for the following exercise (see Self-Test 2-4 for detailed instructions), rounding each answer to the nearest whole number. Using the frequency distribution below (scores on a statistics exam taken by 80 students), determine:ion 1 of the preliminary test (scores on a statistics exam taken by 80 students), determine: 68 84 75 82 68 90 62 88 76 93 73 79 88 73 60 93 71 59 85 75 61 65 75 87 74 62 95...

  • Use the Grouped Distribution method for the following exercise (see Self-Test 2-4 for detailed instructions), rounding...

    Use the Grouped Distribution method for the following exercise (see Self-Test 2-4 for detailed instructions), rounding each answer to the nearest whole number. Using the frequency distribution below (scores on a statistics exam taken by 80 students), determine:ion 1 of the preliminary test (scores on a statistics exam taken by 80 students), determine: 68 84 75 82 68 90 62 88 76 93 73 79 88 73 60 93 71 59 85 75 61 65 75 87 74 62 95...

  • A professor has constructed a 3-by-4 two-dimensional array of float numbers. This array currently contains the...

    A professor has constructed a 3-by-4 two-dimensional array of float numbers. This array currently contains the lab grades, quiz grades and exam grades of three students in the professor’s class. Write a C++ program that calculate the final grade for each student and save it to the last column. You program should display the following output: Lab Quiz ExamFinal Student 1 ## ## ## ## Student 2 ## ## ## ## Student 3 ## ## ## ## The final grade...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT