1. Engineering
  2. Computer Science
  3. twenty students were asked to participate in a survey to...

Question: twenty students were asked to participate in a survey to...

Question details

Twenty students were asked to participate in a survey to rate their experience with a tutoring center on a scale of 1 to 5 (where 1 means awful and 5 means excellent). Write a program that stores the 20 responses entered by the user in an integer array and summarize the results by displaying the number of occurrences of each response (1 to 5). As part of the solution, write and call the function calculate() with the following prototype. n1 is the size of the array of the responses and n2 is the size of the array of frequency.


void calculate(int responses[], int n1, int frequency[], int n2);


Example input/output #1:
Enter 20 responses: 1 4 5 3 5 3 5 2 4 5 2 4 5 5 3 4 5 3 3 1

Output:
Rating   Frequency
1                2
2                2
3                5
4                4
5                7

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution