c solution 1 histogram generate a text based histogram for a sequence of grades to a 5148635

C++ solution


1. Histogram Generate a text-based histogram for a sequence of grades to a class of students. The grades are [A- D, F]. Write a program that allows the user to enter grades of students in upper/lower case. As the grades are being entered, the program should count, using an array, the number of As, the number of Bs, the number of Cs, the number of Ds, and the number of Fs. The program should be capable of handling an arbitrary number of student grades. However, the input should end when an invalid grade is encountered. To design your counters, use an array of size 5 where each array element is initialized to zero. Whenever an A or a is entered, increment array[O]. Whenever a B or b is entered, increment array[1], etc. up to array[4]. Output the histogram count and the bar- chart too as shown below Sample input/output nter sequence of valid grade [A ending with an invalid grade to stop: grade(s) of A bar-chart: grade(s) of B bar-chart: grade (s) of Cbar-chart: ** grade (s) of D; bar-chart: grade (s) of F bar-chart: nter sequence of valid grade [A-F ending with an invalid grade to stop: bcdfdbbBBAcDffFFFp grade(s) of A bar-chart: ** grade(s) of B bar-chart: grade(s) of C bar-chart: ** grade(s) of D bar-chart: grade(s) of F bar-chart: 1. Histogram Generate a text-based histogram for a sequence of grades to a class of students. The grades are ['A'- 'D', 'F']. Write a program that allows the user to enter grades of students in upper/lower case. As the grades are being entered, the program should count, using an array, the number of A's, the number of B's, the number of C's, the number of D's, and the number of F's. The program should be capable of handling an arbitrary number of student grades. However, the input should end when an invalid grade is encountered. To design your counters, use an array of size 5 where each array element is initialized to zero. Whenever an 'A” or 'a' is entered, increment array[O]. Whenever a 'B or 'b' is entered, increment array[1], etc. up to array[4]. Output the histogram count and the bar- chart too as shown below Sample input/output nter sequence of valid grade ['A'' ending with an invalid grade to stop: grade(s) of A bar-chart: grade(s) of B bar-chart: grade (s) of Cbar-chart: ** grade (s) of D; bar-chart: grade (s) of F bar-chart: nter sequence of valid grade ['A-F' ending with an invalid grade to stop: bcdfdbbBBAcDffFFFp grade(s) of A bar-chart: ** grade(s) of B bar-chart: grade(s) of C bar-chart: ** grade(s) of D bar-chart: grade(s) of F bar-chart:

“Get 15% discount on your first 3 orders with us”
Use the following coupon
FIRST15

Order Now