Write a method called coinFlip that accepts a Scanner representing an input file of coin flips that are heads (H) or tails (T). Consider each line to be a separate set of coin flips and output the number and percentage of heads in that line. If it is more than 50%, print “You win!”. Consider the following file:
![]()
For the input above, your method should produce the following output:
3 heads (60.0%)You win!
2 heads (33.3%)
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.