Question

Write a function that will read a collection of examination scores ranging in value from 1...

Write a function that will read a collection of examination scores ranging in value from 1 to 100. Your subprogram should count and print the number of scores in the outstanding category ( 90 – 100), the number of scores in the satisfactory category ( 60-89), and the number of scores in the unsatisfactory category ( 1-59). The test data for the subprogram is :

63           75           72

72           78           67

80           63           75

90           89           43

59           99           82

12           100

Homework Answers

Answer #1

#include <iostream>

using namespace std;
void catagorize(int score[17])
{
   int j=0;     //counters for 3 arrays for 3 categories
   int k=0;
   int l=0;
   int count1,count2,count3;
   int outstanding[17],satisfactory[17],unsatisfactory[17]; //three arrays for 3 categories
   count1=count2=count3=0;
   for(int i=0;i<17;i++)
   {
       if(score[i] >=90 && score[i] <=100)
       {
       outstanding[j] = score[i];
       j++;
       count1++;    //increment count1
       }
       else if(score[i] >=60 && score[i] <=89)
       {
       count2++;    //increment count2 for satisfactory category
       satisfactory[k] = score[i];
       k++;
       }
       else if(score[i] >=1 && score[i] <=59)
       {
      
           count3++;    //increment count for unsatisfactory category
           unsatisfactory[l]= score[i];
           l++;
       }
   }
       //display different caregories of score with counts
       cout<<"\nScores in outstanding category : "<<count1<<endl;
       for(j=0;j<count1;j++)
       cout<<outstanding[j]<<"\t";
      
       cout<<"\nScores in satisfactory category : "<<count2<<endl;
       for(j=0;j<count2;j++)
       cout<<satisfactory[j]<<"\t";
      
       cout<<"\nScores in unsatisfactor category : "<<count3<<endl;
       for(j=0;j<count3;j++)
       cout<<unsatisfactory[j]<<"\t";
  
}

int main() {
   int score[17];
   cout<<"Enter scores \n";
   for(int i=0;i<17;i++)
   {
       cin>>score[i];
   }
   catagorize(score);
   return 0;
}

output:

Enter scores 63 75 72 72 78 67 80 63 75 90 89 43 59 99 82 12 100

Scores in outstanding category : 3
90      99      100     
Scores in satisfactory category : 11
63      75      72      72      78      67      80      63      75      89      82      
Scores in unsatisfactor category : 3
43      55      12      
Know the answer?
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
Similar Questions
The following scores represent a sample of final examination grades for a statistics course 23 60...
The following scores represent a sample of final examination grades for a statistics course 23 60 98 32 57 74 52 70 82 69 74 63 80 62 80 77 81 95 41 65 92 85 85 61 36 79 55 76 52 10 64 75 78 25 80 48 83 64 88 82 81 67 41 71 67 54 34 72 74 43 60 78 84 89 76 84 17 90 15 79 a) Compute the 20th percentile of...
Below represent scores on an exam, each entry one score for one student 40 99 59...
Below represent scores on an exam, each entry one score for one student 40 99 59 98 63 63 64 65 67 35 67 67 68 70 71 71 71 46 72 72 60 73 74 74 74 75 97 75 62 76 76 76 76 76 77 57 77 98 77 63 78 78 78 79 79 80 80 80 80 80 81 81 92 81 93 82 82 83 83 83 83 83 83 83 84 84 84...
The following scores represent a sample of final examination grades for a statistics course 23 60...
The following scores represent a sample of final examination grades for a statistics course 23 60 98 32 57 74 52 70 82 69 74 63 80 62 80 77 81 95 41 65 92 85 85 61 36 79 55 76 52 10 64 75 78 25 80 48 83 64 88 82 81 67 41 71 67 54 34 72 74 43 60 78 84 89 76 84 17 90 15 79 a) Provide a frequency polygon with...
TestScore 53 53 56 56 56 58 58 58 59 59 59 60 60 62 63...
TestScore 53 53 56 56 56 58 58 58 59 59 59 60 60 62 63 63 63 64 65 65 66 67 67 67 67 68 69 69 69 69 71 71 72 72 72 72 73 73 73 73 73 74 75 75 75 76 76 76 76 77 77 77 77 77 78 78 78 79 79 79 79 80 80 80 80 80 80 81 81 81 82 82 83 83 83 83 84 84 84...
Question 2: Write a C program that read 100 integers from the attached file (integers.txt) into...
Question 2: Write a C program that read 100 integers from the attached file (integers.txt) into an array and copy the integers from the array into a Binary Search Tree (BST). The program prints out the following: The number of comparisons made to search for a given integer in the BST And The number of comparisons made to search for the same integer in the array Question 3 Run the program developed in Question 2 ten times. The given values...
Below are the examination scores of 20 students. 52 99 92 86 84 63 72 76...
Below are the examination scores of 20 students. 52 99 92 86 84 63 72 76 95 88 92 58 65 79 80 90 75 74 56 99 ​ a. Construct a frequency distribution for these data. Let the first class be 50–59 and draw a histogram. b. Construct a cumulative frequency distribution. c. Construct a relative frequency distribution. d. Construct a cumulative relative frequency distribution.
Student Grades Student Test Grade 1 76 62 2 84 90 3 79 68 4 88...
Student Grades Student Test Grade 1 76 62 2 84 90 3 79 68 4 88 84 5 76 58 6 66 79 7 75 73 8 94 93 9 66 65 10 92 86 11 80 53 12 87 83 13 86 49 14 63 72 15 92 87 16 75 89 17 69 81 18 92 94 19 79 78 20 60 71 21 68 84 22 71 74 23 61 74 24 68 54 25 76 97...
Question 1: Table 1 shows the number of customers visited by a salesman over an 80-week...
Question 1: Table 1 shows the number of customers visited by a salesman over an 80-week period. Table 1: Customers Visited Over an 80-Week Period 68 64 75 82 68 60 62 88 76 93 73 79 88 73 60 93 71 59 85 75 61 65 75 87 74 62 95 78 63 72 66 78 82 75 94 77 69 74 68 60 96 78 89 61 75 95 60 79 83 71 79 62 67 97 78...
Mid Score Final Score 80 78 87 85 72 81 69 54 86 70 83 73...
Mid Score Final Score 80 78 87 85 72 81 69 54 86 70 83 73 78 89 75 84 74 86 75 79 84 75 73 63 74 72 73 69 80 86 75 78 72 75 77 68 76 77 66 78 74 77 71 73 85 79 74 74 76 79 76 73 84 72 77 81 78 86 86 76 81 83 78 83 85 86 73 71 83 83 83 79 72 68 83 90...
Create the appropriate frequency distribution graph by hand. Below are the speeds of cars clocked by...
Create the appropriate frequency distribution graph by hand. Below are the speeds of cars clocked by radar on a 35-mph zone of a road on a particular afternoon. 99, 96, 94, 91, 90, 90, 89, 87, 85, 84, 82, 80, 79, 78, 77, 76, 34, 75, 75, 74, 74, 72, 70, 69, 68, 68, 68, 66, 66, 65, 63, 63, 60, 59, 58, 58, 54, 50, 48, 46, 42, 38, 33, 12
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT