The+Shooting+Gallery

=The Shooting Gallery= toc

The Game
The owner of a shooting gallery in the fairground has approached you for advice. He wants to know how much he should charge a player to play.

The object of the game is to shoot at a plate to break it. The player pays and gets three (3) shots only. If the player hits three plates with the three shots he or she wins a prize that costs $20. Each plate that is broken costs $1.50 to replace.

The way the game is set up, it is estimated that there is a probability of 0.25 (25%) that a plate will be hit with one shot.

In one day the owner expects an average of 1000 people playing the game and needs to make at least $1500 to cover the owner's costs and produce a small profit.

What should the owner charge?

General Instructions

 * Choose appropriate names for the parameters (variables that don't vary too much) and **initialize** them when the flag is clicked. Examples: Maximum shots allowed, Cost of prize, Maximum number of people per day, Probability of a hit ...
 * Choose appropriate variables for the simulation. Examples: Shot number, Total plates hit, ...
 * Write a Scratch program for one person to play this game, keeping your options open

Option 1
Write a Scratch program that simulates 1000 people playing this game. Display the result for the owner.

Option 2
Write a Scratch program that allows the player to choose how many times to play. Make sure the plates are small enough and move fast enough to simulate 25% chance of a hit

Option 3
Solve this problem mathematically. Provide a detailed solution method.

Top-Down Design, Bottom-up Coding
Here is a top-down approach to help you write the script from the bottom up.

Pseudo-code
set up simulation parameters
 * total plates broken
 * total prizes won

for 1000 players
 * set up game parameters
 * Max shots allowed
 * Reset play variables
 * Number of plates broken
 * Number of shots


 * for each player
 * play game {start codeing here, but keep in mind the bigger picture}


 * update total plates & total prizes

calculate price to charge display results