Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how to write java program that simulates flipping a coin 100 times (head/tail needs to be generated randomly all 100 times) and display the total

how to write java program that simulates flipping a coin 100 times (head/tail needs to be generated randomly all 100 times) and display the total number of heads and tails at the end. Sample Output-1: Assume you are generating 5 random flips (tail, tail, tail, head, tail} Note - This is just an assumption for sample output. In your code you need to generate 100 times Result: Total number of Heads = 1 Total numner of Tails = 4 Sample Output-2: Assume you are generating 10 random flips {tail, tail, tail, head, tail, head, head, head, head, head} Note - This is just an assumption for sample output. In your code you need to generate 100 times Result: Total number of Heads = 6 Total numner of Tails = 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Java import javautilRandom public class CoinFlipSimulator public static void mainString args Rand... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

John E Freunds Mathematical Statistics With Applications

Authors: Irwin Miller, Marylees Miller

8th Edition

978-0321807090, 032180709X, 978-0134995373

More Books

Students also viewed these Programming questions