Algorithm Academy
Input or Output?
Text Variable Vault
Trace It
Debugging & Swapping
100

This is a finite set of steps used to complete a task or solve a problem

What is an algorithm?

100

This is the data or material an algorithm receives.

What is input?

100

This is a named storage location that holds a word or phrase.

What is a text variable?

100

color <-- "gold"

color <-- "blue". 

Give the final value of color.

What is "blue"?

100

Finding and correcting a faulty or unclear step.

What is debugging?

200

This term means the order in which instructions run

What is sequence?

200

This is the result an algorithm produces.

What is output?

200

These punctuation marks usually surround text values in code.

What are quotation marks?
200

pet <-- "dog"; pet <-- "cat"; Display (pet).

Give the output.

What is "cat"?

200

This type of variable saves a value during a swap.

What is temporary variable?

300

A strong algorithm avoids these kinds of instructions because they require guessing.

What are vague or unclear instructions?

300

A login system receives a username and password. These are examples of this.

What are inputs?

300

In pet <-- "dog"

Identify the variable's name and its stored text.

What are pet and "dog"?

300

first <-- "Ari";

second <-- first;

first <-- "Dee".

Give the final value of second.

What is "Ari"?

300

Start with left =

"RED" and right =

"Blue". Run left <--

right; right <-- left.

What are the final values?

Both contain "BLUE."

400

A student's directions say, "Put the sandwich together," without explaining how. Explain why this is a weak algorithm.

What is the instructions are not precise enough to follow without guessing?

400

A login system displays "Access Granted." This message serves this role.

What is output?

400

Explain what the assignment arrow does in message <-- "Welcome".

What is stores "Welcome" in the variable message?

400

team <-- "Tigers";

saved <-- team; team <-- "Eagles". 

Give both final values.

team = "Eagles"; saved = "Tigers"

400

Why does the two-line swap above fail?

"RED" is overwritten before it is saved.

500

Name four features of strong algorithm from the study guide.

What are a clearly named input, precise numbered steps, no vague wording or guessing, and a measurable output?

500

A student enters a name, and a program displays a personalized greeting. Identify both the input and output.

What are the entered name as input and the displayed greeting as output?

500

Explain the difference between second <-- first and second <-- "first".

What is the first copies the text stored in first, while the second stores the literal word "first"?

500

first <-- "Ari";

second <-- first;

first <-- "Dee"; third 

<-- second; second <-- first. 

Give all three final values.

first = "Dee"; second = "Dee"; third = "Ari"

500

Write three assignments that correctly swap the values of left and right.

temp <-- left; left <-- right; right <-- temp

M
e
n
u