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 the Random number generator function returns a floatingpoint number between and The program should not run once then terminate, instead insert your code in a while loop that turns at least 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 ms 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
