# Code breaking using Trace Tables

In the following set of challenges, you will use a trace table to workout the secret code of the following six padlocks. Before attempting this challenge, you may want to find out mode about the use of trace tables when testing or predicting the output of an algorithm.

The following code will help you work out the combination (code) to open padlock #1 (see below)

#### Trace Table

Line NumberidigitcodeOUTPUT
1“”
21
32
4“2”
22
34
4“24”
23
36
4“246”
6246

Input the combination on the padlock below and click on “Unlock?” to test your combination.

The following code will help you work out the combination (code) to open padlock #2 (see below)

#### Trace Table

Complete the following trace table to work out the 3-digit padlock code:
Line NumbercodeOUTPUT
1

Input the combination on the padlock below and click on “Unlock?” to test your combination.

The following code will help you work out the combination (code) to open padlock #3 (see below)

#### Trace Table

Complete the following trace table to work out the 3-digit padlock code:
Line NumbercodeOUTPUT
1

Input the combination on the padlock below and click on “Unlock?” to test your combination.

The following code will help you work out the combination (code) to open padlock #4 (see below)

#### Trace Table

Complete the following trace table to work out the 3-digit padlock code:
Line Numbercodecode MOD 2 == 0 ?OUTPUT
1

Input the combination on the padlock below and click on “Unlock?” to test your combination.

The following code will help you work out the combination (code) to open padlock #5 (see below)

#### Trace Table

Complete the following trace table to work out the 3-digit padlock code:
Line Numbercodecode>20 ?code<=10 ?OUTPUT
1

Input the combination on the padlock below and click on “Unlock?” to test your combination.

The following code will help you work out the combination (code) to open padlock #6 (see below)

#### Trace Table

Complete the following trace table to work out the 3-digit padlock code:
Line Numbercodecode<1000 ?OUTPUT
1

Input the combination on the padlock below and click on “Unlock?” to test your combination.

Did you like this challenge?

Click on a star to rate it!

Average rating 4.3 / 5. Vote count: 6

No votes so far! Be the first to rate this post.

As you found this challenge interesting...