Exercise One - Fizz Buzz

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

Note: This question is somewhat famous within the professional programming world because it is concidered the baseline for what someone must be able to slove inorder to call oneself a "programmer". Check out Jeff Atwood's blog to read more about why it's so important.

Exercise Two - Flagged loops

Write a programm that takes the average of user input numbers. Keep prompting the user to input another number untill they enter -1. Then print the average of the numbers (besides -1).

Exercise Three - boolean logic practice, string comparison

Figure out if you can skip class or not. Write a program that asks the user

Have you missed this class before? (yes or no)

and

Are you doing well in this class? (yes or no)

The programs output should follow this chart

Missed class before     Doing well     Output
truetrue"I really shouldn't miss this class"
truefalse"I really shouldn't miss this class"
falsetrue"I can afford to miss this class"
falsefalse"I really shouldn't miss this class"

Exercise Four - Input loops, Number Comparison

Find the greatest integer in a set of integers. First ask the user how many numbers in the set and then use a for loop to ask the user for each of the integers

example:1, 6, 2, 7, 12, 4, 3, 2, 8, 5, 7, 9, 2 will output The greatest number in the set is 12

Home Work

Recreate '99 bottles of beers on the wall' using a for loop. The output should look like this:

99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.

98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of beer on the wall.

97 bottles of beer on the wall, 97 bottles of beer.
Take one down and pass it around, 96 bottles of beer on the wall.

96 bottles of beer on the wall, 96 bottles of beer.
Take one down and pass it around, 95 bottles of beer on the wall.

95 bottles of beer on the wall, 95 bottles of beer.
Take one down and pass it around, 94 bottles of beer on the wall.

....

3 bottles of beer on the wall, 3 bottles of beer.
Take one down and pass it around, 2 bottles of beer on the wall.

2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, 1 bottle of beer on the wall.

1 bottle of beer on the wall, 1 bottle of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.
        

Things to study for next week