Tutorial 4 Exercises

  • Write a program that makes a variable x, sets it equal to a number between 1 and 5, and then uses an if-else-if-else chain to print out a different message depending on the number you chose for x. Try it with an ending else clause, and then again without one. Experiment!
  • Write a for loop that counts down from 10 to 1, and then announces that you have landed in another dimension, another time, a place not only of sight and sound, but of mind: the Twilight Zone! Da da dun...

Like the site?
Let people know:
Digg! StumbleUpon
			Toolbar del.icio.us