# Exercise 1.1

One student will explain how to draw an image under the following restrictions.

• You may not use your hands.
• You may only describe individual shapes, not composites.
• You may ignore color.

The rest of the students should try to draw the figure according to the instructions.

# Exercise 1.2

Explain what the following algorithm does.

1. Given: two positive natural numbers a & b
2. Set remainder = some non-zero value
3. Repeat these steps until remainder = 0
1. Set remainder = the remainder of a divided by b
2. If remainder = 0 Then
1. Print GCD is b
3. Else
1. Set a = b and b = remainder
4. Go on to the next repetition
4. Test Cases: GCD(36,16)→4; GCD(1,1)→1; GCD(1260,198)→18

# Exercise 1.3

Write an algorithm for sorting cards under the following restrictions.

• The cards start face down on the table.
• The instructions must be for only one person.
• The person moving the cards can only have one card in each hand at any point (i.e. s/he can only look at the values of two cards).
• The instructions can’t require that the person remember the value of a card once they put it down. You can however use the space on the table however you like.

# Exercise 1.4

Write algorithms that implement solutions to the following problems.

1. We’d like to print the following famous phrase “My name is Bond, James Bond.” using whatever first and last names the user enters.

2. We’d like to print the sum of any two numbers the user enters.