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...
Consider the below vector x, which you can copy and paste directly into Matlab. The vector...
Consider the below vector x, which you can copy and paste directly into Matlab. The vector contains the final grades for each student in a large linear algebra course. x = [61 52 63 58 66 92 64 55 76 60 70 78 76 73 45 63 97 70 100 76 50 64 42 100 67 81 81 59 68 62 72 99 66 76 81 59 47 84 67 75 63 86 73 44 51 69 48 74 61...
have a java application need to create an application which is able to do some analysis...
have a java application need to create an application which is able to do some analysis on temperature data stored in a data file. You will be given the “temperatures.dat” data file which contains the data you must analyze. The analysis you’ll need to do is: Total number of data points Find coldest temperature Find warmest temperature Find average temperature Find the frequency of each temperature Find the most frequent temperature Find the least frequent temperature All classes must be...
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...
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...
You are to write a program that will process students and their grades. For each student...
You are to write a program that will process students and their grades. For each student the program will read in a student’s name. It should also read in 10 test scores for the student and calculate his or her average. You must read the scores using a loop. The program should output the student’s name, average and letter grade. The average should be displayed accurate to 1 decimal digit. Letter grades are assigned based on the scale: 90-100    A...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT