bubu_bus2003
10-10-2007, 07:55 PM
I have to write a program where a user input's the number of grades.A's, B's,C's, D's and F's.The program has to calculate the total number of grades and than the percentage of each grade.I've done this allready.Then, it has to show the percetages with asterisks (*).Each asterisk represents 2%, so there are 50 stars for 100%.We have a standard graph(done with "system.out.println() ) that looks loke this:
0 10 20 30 40 50 60 70 80 90 100
| | | | | | | | | | |
************************************************** ******(50 asterisks)
Then it has to show this(The part I don't know how to do)
If we have 20% A's (10 asterisks),10% B's(5 asterisks), 15%C's(7 asterisks) etc the result is:
********** A
***** B
******* C
etc. Use mod(%) because percentages are double.example for C
0 10 20 30 40 50 60 70 80 90 100
| | | | | | | | | | |
************************************************** ******(50 asterisks)
Then it has to show this(The part I don't know how to do)
If we have 20% A's (10 asterisks),10% B's(5 asterisks), 15%C's(7 asterisks) etc the result is:
********** A
***** B
******* C
etc. Use mod(%) because percentages are double.example for C