Hit the green flag to make ten calculations! "Tosses" displays how many coins you want to toss! "Average" displays the percentage of the coins that are heads! "Heads" displays the number of heads, out of the number of tosses Use the number keys to define how many coins you want to toss! 0 = 1 coin 1 = 10 coins 2 = 50 3 = 100 4 = 250 5 = 500 6 = 1000 7 = 2500 8 = 5000 9 = 10.000 (maximum tosses for scratch) Have fun!
I made this project based off a chapter of my maths book. We were making exercises the Probability Theory, and we had to experiment with tossing coins. I was interested in this, and I came up with a program to calculate the average of tossing many coins. This works using three variables. One for the number of tosses, one for the average of heads, and one for the number of heads. When you click the green flag, it starts a loop. It will then pick a random number between 0 and 1, it will round it up and repeat that for the number of tosses. Each times it adds the rounded up digit to the total of heads. After that, it will display the total heads, and calculate the average by dividing the number of heads with the number of tosses. This is done in just one second, and loops it ten times after that. When you press the number keys, it will simply set the number of tosses, according to the number you press.