Intro to Java: HeadsTails App
Write a program that will compute statistics for eight coin tosses. The user will enter either an h for heads or a t for tails for the eight tosses. The program will then display the total number and percentages of heads and tails. Use the increment operator to count each h and t that is entered.
(I only need the source code-thanks!)
Example:
For each coin toss enter either h for heads or t for tails.
Toss 1: h
Toss 2: t
Toss 3: t
Toss 4: h
Toss 5: t
Toss 6: h
Toss 7: t
Toss 8: t
Number of Heads: 3
Number of Tails: 5
Percent heads: 37.5
Percent tails: 62.5