How did you sort this?
Im trying to learn aswell.
Type: Posts; User: djl1990
How did you sort this?
Im trying to learn aswell.
Yes, also like the poster above said, the calculations are doing 8*100 first.
Maybe you should try changing the maths around and do: (headcount) * 100 / 8
That should give you the correct...
Hmmmmmmmm something is still not right it gives the following results
The total amount of 'Heads' entered is:
8
The total amount of 'Tails' entered is:
8
The percentage of 'Heads' is:
0
The...
Also where you calculate the percentage here:
float percentHeads = (headCount++) / 8 * 100;
float percentTails = (tailCount++) / 8 * 100;
you dont want to divide headcount++ and tailCount++ ,...
When your printing out values such as headCount and percentHeads you dont need quotation marks.
You just need the value in the brackets such as:
System.out.println ("The total amount of 'Heads'...