Showing posts with label counter. Show all posts
Showing posts with label counter. Show all posts

Thursday, January 1, 2015

Coin Flipping Counter

Here is a simple program where the computer flips a coin 100 times and outputs the number of Heads and Tails.

Here is the basic outline:
  1. Explain the program
  2. Set initial parameters
    1. # of heads
    2. # of tails
    3. # of flips
  3. Loop that flips coin 100 times and keeps tracks of Head or Tails
  4. Diplay total number of Heads and Tails
  5. User presses enter to exit program