subject

Me write this code!
starting small
to start, we're going to simulate flipping a coin 10 times. you might be thinking that isn't many coin flips, and that we could just do those flips in real life, but this is actually an important step in developing a simulation. at small scales we can make sure our code is working as intended because we can still visually confirm its output. once we're convinced that the logic of our program is reliable we'll move up to simulating larger numbers of flips.

the core logic of our program will be focused on a while loop that simulates flipping a coin by repeatedly generating random 0's or 1's using randomnumber. this is a great opportunity to keep practicing using loops while applying your knowledge of variables, iteration, and if statements.

do this:
when we want to flip a coin with a computer we will instead generate a random number between 0 and 1.
write a program that uses a while loop to flip a coin 10 times and writes the value of each flip to the screen. the example below shows how your program should run.
hint: you will need to use a counter variable in your while loop to keep track of how many times the coin has been flipped.

ansver
Answers: 3

Another question on Advanced Placement (AP)

question
Advanced Placement (AP), 22.06.2019 08:00
Ineed on this equation what is the real value of x in the equation [tex]log_2}24 - log_{2} 3 = log_{5}x[/tex] a. 3 b. 21 c. 72 d. 125 e. 243
Answers: 1
question
Advanced Placement (AP), 25.06.2019 16:00
Evidence suggests that the ancient romans had a very formal medical system. it included which of the following? click all that apply. medical schools universities physician apprenticeships nursing homes hospital facilities
Answers: 1
question
Advanced Placement (AP), 25.06.2019 20:00
When you are driving slowly in the freeway fast lane, blocking traffic which wishes to pass you should
Answers: 1
question
Advanced Placement (AP), 25.06.2019 23:00
For which plan or plans. is knowing the withdrawal restrictions important ?
Answers: 3
You know the right answer?
Me write this code!
starting small
to start, we're going to simulate flipping a coin 1...
Questions
question
Mathematics, 20.01.2021 01:00
question
History, 20.01.2021 01:00
question
English, 20.01.2021 01:00
question
Mathematics, 20.01.2021 01:00
question
Mathematics, 20.01.2021 01:00