Question: Create a Class that represents a grade distribution for a given course. Write methods to perform each of the following tasks: Set the number of
Create a Class that represents a grade distribution for a given course. Write methods to perform each of the following tasks:
Set the number of each of the letter grades A, B, C, D and F.
Return the number of each of the letter grades A, B, C, D and F.
Return the total number of grades.
Return the percentage of each letter grade as a whole number between 0 and 100, inclusive.
Draw a bar graph of the grade distribution.
The graph will have ve 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 0 to 100 percent, and label each line with its letter grade.
For example, if the grades are 1 A, 4 B's, 6 C's, 2 D's 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 F's is 7. The A row would contain 4 asterisks (7 percent of 50 rounded o 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:
0 10 20 30 40 50 60 70 80 90 100%
| | | | | | | | | | |
***************************************************
**** A
************** B
********************* C
******* D
**** F
1.1 First steps Write your getters and setters rst. Work on the drawGraph() method last. You will need to write separate class with a main method to create a GradeDistribution object to run this code.
please follow the intructions step by step and using JAVA solve the problems. Make sure the code is working and with the comments shows how to the code working.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
