Question
A program that represents a grade distribution for a given course.Have the main part of the program read in the course number,and the number for
A program that represents a grade distribution for a given course.Have the main part of the program read in the course number,and the number for each of the letter grades A,B,C,D and F.For examplethere are 5 A's4 B'setc.That is the only input.
Have a functionacceptthe number of each of the letter grades andreturnthe sum of the number of grades or how many grades there are all together.
Have a function thatacceptsone number of letter grades, the sum (the total number of grades ) , andreturnsthepercentageof that grade as a whole number between 0 and 100, inclusive.Notice that this function will be called five times for each of the letter grades' counts and you will have five percentages.
Store the percentages in the list( probably in the main part )
Have a functionacceptsthe list offive percentages, anddrawsa bar graph of the grade distribution( See below for example )
The graph will have five bars, one per grade.Each bar can be a horizontal row of asterisks, such that the number of asterisks in a row is proportionate to the percentage of grades in each category.Let one asterisk represent 2 percent, so 50 asterisks correspond to 100 percent.Mark the horizontal axis at 10 percent increments from 1 to 100 percent, and label each line with its letter grade.
Once you have completed this chart for one class,wrap the main code in a for loop to execute this at least twice for another class
For example, if the grades are 1A, 4Bs, 6Cs, 2Ds, and 1 F, the total number of grades is 14, the percentage of A's is 7, the percentage of B's is 29, the percentage of C's is 43, the percentage of D's is 14, and the percentage of Fs is 7.The A row would contain 4 asterisks ( 7 % 0f 50 rounded to the nearest integer ), the B row 14, the C row 21, the D row 7 and the F row 4.The graph would look like this:
0102030405060708090100
*********************************************
****A
**************B
*********************C
*******D
****F
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started