it would use the above idea to gather the data.
read the file into the buckets above.
most and least favorable response is just right there, for 0-10 find the highest value in bucket, for 0-10 find the lowest bucket (can do in same loop!).
print the historgram ... a simple sideways one is a double loop... for all the buckets, for the number in the buckets (say/5.0 since you have ? 50 people) print *.
frequency... common english or engineering statistics type question? I can't remember the equation... but google knows it, find it and wrap it up.
the whole thing is like 50 lines of code including comments and function headers and variables and the whole 9 yards.
Start simple. read the file into the hint design I gave you, and then do iii (the most and least common answers). Show us a solid real attempt at that.
We prefer not to do peoples' homework for them. Its boring, usually, and they keep coming back for more if you do it, and they don't learn anything and graduate and get hired and then we have to do their work for them too, it never really ends. The only way to break the cycle is to offer help once effort has been given. Honestly I all but coded this one, though. There isnt much left but syntax.
#include <iostream>
#include <cctype>
#include <limits>
int main()
{
std::cout << "Do you want someone to do all the work for you? ";
char answer{};
std::cin >> answer;
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
if (std::toupper(answer) == 'Y' ) { std::cout << "Post it in the Jobs section.\n"; }
else { std::cout << "Show what you have coded so far.\n"; }
std::cout << "Good luck.\n";
}
Hint: if I do all the work for you, I am not cheap.