Menu

(Solved) : Generate Text Based Histogram Sequence Grades Class Students Grades D F Write Program All Q32967234 . . .

Chapter # 8 (Arrays) Problem 1 1. Histogram Generate a text-based histogram for a sequence of grades to a class of students. The grades are l[A D, F]. Write a program that allows the user to enter grades of students in upperlower 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 desien 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 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 Enter sequence of valid grade [A-F ending with an invalid grade to stop: grade(s) of A bar-chart: grade(s) of B bar-chart grade(s) of C; bar-chart:** grade(s) of Dbar-chart: grade(s) of Fbar-chart: Enter sequence of valid grade [A-F] ending with an invalid grade to stop: cdfdbbBBAcDffFFFp 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:

Generate a text-based histogram for a sequence ofgrades to a class of students. The grades are [‘A’-
‘D’, ‘F’]. Write a program that allows the user to enter grades ofstudents in upper/lower case. As
the grades are being entered, the program should count, using anarray, the number of A’s, the
number of B’s, the number of C’s, the number of D’s, and the numberof 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 arrayof size 5 where each array
element is initialized to zero. Whenever an ‘A” or ‘a’ is entered,increment array[0]. Whenever a ‘B’
or ‘b’ is entered, increment array[1], etc. up to array[4]. Outputthe histogram count and the barchart too as shown below.

Chapter # 8 (Arrays) Problem 1 1. Histogram Generate a text-based histogram for a sequence of grades to a class of students. The grades are l[‘A D’, ‘F’]. Write a program that allows the user to enter grades of students in upperlower 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 desien 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 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 Enter sequence of valid grade [‘A’-F’ ending with an invalid grade to stop: grade(s) of A bar-chart: grade(s) of B bar-chart grade(s) of C; bar-chart:** grade(s) of Dbar-chart: grade(s) of Fbar-chart: Enter sequence of valid grade [‘A-F’] ending with an invalid grade to stop: cdfdbbBBAcDffFFFp 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: Show transcribed image text

Expert Answer


Answer to Generate Text Based Histogram Sequence Grades Class Students Grades D F Write Program All Q32967234 . . .

OR