email me at borlaj@portlandschools.org

Loading
notes previous (10/<10) submit the dump links  
 

Programming activities

 

Use this as a Guide

For a random number between 1 and 6-------- ipart(rand*6+1)

  1. Have a program DOGSAGE that ask for their dogs age and calculates how old in human years it is. each year =7 dog years
  2. Have a program DOGSAGE2 that ask for their dogs age and calculates how old in human years it is. (1st year =15years, 2nd year =9 years, 3+=5 years)
  3. Have a program FLIPCOIN that will flip a coin and spit out heads or tails.
  4. Create a program MAGIC8 that will say "ask a yes or no question" and then people will hit enter (use PAUSE) and then say randomly 1 of 6 statements ("Most definitely", "Outlook not clear", "Unlikely", "Yes", "No", "Who cares!"
  5. Create a program RANDOM that will spit out 100 random numbers between 1 and 10000
  6. Create a program NUMFLIPS that will ask the user how many coin flips should I do? Then not showing the flips, but at the end it will output, how many heads (and what percentage), how many tails (and what percentage).
  7. Create a program called FACTORIAL that will find the factorial of a number (ie 9 factorial is 9*8*7*6*...1 is 362 880. You must use a loop.
  8. Create a program STARS that will print out * then ** then *** then **** and so on fro 12 rows.

 

Advanced

  1. Create a number guessing game. The idea is that the computer will guess a number between 1 and 100 and then ask the user to guess continually until they succeed. It should say too high or too low. It should allow them to quit (type 0) and at the end report their score, how many guesses it took.
  2. Create a simple blackjacklike game, with just one user. Where they try to get between 18-21. Where JQK are 10 points, 2-9 are worth their value and Ace is 11. They cant hit until they either win or bust. Keep track of money.