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

Other questions on the subject: Advanced Placement (AP)

image
Advanced Placement (AP), 23.06.2019 12:30, alexis0430
Write in detail! for free points + brainliest! you have a green light and are turning right at an intersection, but there is a pedestrian in the crosswalk. explain how you should handle this situation.
Answers: 2
image
Advanced Placement (AP), 24.06.2019 08:00, 22norvd
What statement is true about all chemical changes? a) chemical changes can be undone. b) chemical changes cannot be reversed. c) chemical changes change the color of objects. eliminate d) chemical changes do not form new products.
Answers: 2
image
Advanced Placement (AP), 25.06.2019 11:40, valerrry
What is a system where wealth and property are privately held and profit is the goal rather than providing for collective needs? a. capitalism b. socialism c. communism d. feudalism
Answers: 1
image
Advanced Placement (AP), 25.06.2019 15:50, AmyGonzalez1385
This is an ap world history question. i am working on a worksheet which has a vent diagram with each circle labeled either us or byzantine economy. the middle is the similarities. can someone explain to me the similarities and especially the differences between the two?
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 in other subjects:

Konu
Geography, 05.02.2020 09:44
Konu
Geography, 05.02.2020 09:44