a. Write an application that displays the results of a series of 10 coin tosses. Use the Math . random () function explained in Appendix D to generate a number between 0 and 1; you will use a statement similar to:
result = Math. random();
After each coin toss, display whether the toss represents "heads" or "tails? If the result is 0.5 or less, the result represents heads; otherwise, it represents tails. After the 10 tosses are complete, display the percentages of heads and tails. Run the application several times until you are confident that the coin tosses occur randomly. Save the file as FlipCoin.java.
b. Modify the application in Exercise 9a so that you generate 1,000 coin tosses and keep track of the heads and tails. Do not display the coin toss result with each flip, but instead display percentages of the heads and tails after the 1,000 coin tosses are complete. Save the file as FlipCoin2.java.
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.