Question: Create a coin toss program that generates that simulates the toss of a coin. Use the Select function in the comparison palette, where a string

Create a coin toss program that generates that simulates the toss of a coin. Use the "Select" function in the comparison palette, where a string constant "Heads" is wired to the true input and a string constant "tails" is wired to the false input. The output of this function is wired to a string indicator. To determine heads or tails, use a greater than function to determine if the random number generator (found in the Numeric Palette) is greater than 0.5(the Random number generator function returns a floating-point number between 0 and 1). The program should not run once then terminate, instead insert your code in a while loop that turns at least 100 times, then shows the result of the coin toss. (The while loop's 'i' loop counter wired to another ">" function {has a boolean T or F output} which is then wired to the conditional "STOP" terminal). This will stimulate the coin flipping, which is what you expect as the coin turns over and over until it lands. To show that the boolean output can be used by multiple indicators, include an LED indicator for this output and a delay (in this case, maybe 500ms). The user will then see the coin flipping since the string indicator and LED indicator will update with each turn of the while loop. Courageous users can explore using the "picture ring" indicator with two images, one heads, one tails...Or you can explore how to show "Heads" and "Tails" on the LED indicator with a different color for each condition

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!