Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You want to conduct a survey within your classroom, on the quality of canteen's food. You ask each of your class fellows to rank the

You want to conduct a survey within your classroom, on the quality of canteen's food. You ask each of your class fellows to rank the quality of food between 1 and 5 (1 representing excellent quality and 5 representing worst quality). During the survey, you make a list containing the roll# of student and the opinion given by that student. The list can be as follow Roll # Opinion 234 1 235 1 236 5 237 1 238 2 239 3 240 5 241 5 242 1 To get the results of the survey, you need to get the frequency of each opinion. The frequency of an opinion is determined by counting the number of students giving that opinion. For example, for the above list the frequency of value 1 is 4 and frequency of value 4 is 0. After getting the frequency of each opinion/rank, you can easily judge about the quality of the food by seeing through the frequency of each rank. You need to develop a program to calculate the results of this survey. The program inputs the opinion of 50 students and counts the frequency of each opinion. It then displays a report showing the frequency of each opinion. Following is an incomplete program. Complete the program by writing the missing code and test it. void main() { int quality; cout<<"Enter a number between 1 to 5 to rank the quality of food"; cout<> quality; /*Complete the program to frequency of each value and display the result of survey*/ if(quality == 1) cout<<"Canteen's food is excellent "; else if (quality == 2) cout<<"Canteen's food is good "; else if (quality == 3) cout<<"Canteen's food is normal "; else if (quality == 4) cout<<"Canteen's food is bad ";

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago