This is a finite set of steps used to complete a task or solve a problem
What is an algorithm?
This is the data or material an algorithm receives.
What is input?
This is a named storage location that holds a word or phrase.
What is a text variable?
color <-- "gold"
color <-- "blue".
Give the final value of color.
What is "blue"?
Finding and correcting a faulty or unclear step.
What is debugging?
This term means the order in which instructions run
What is sequence?
This is the result an algorithm produces.
What is output?
These punctuation marks usually surround text values in code.
pet <-- "dog"; pet <-- "cat"; Display (pet).
Give the output.
What is "cat"?
This type of variable saves a value during a swap.
What is temporary variable?
A strong algorithm avoids these kinds of instructions because they require guessing.
What are vague or unclear instructions?
A login system receives a username and password. These are examples of this.
What are inputs?
In pet <-- "dog"
Identify the variable's name and its stored text.
What are pet and "dog"?
first <-- "Ari";
second <-- first;
first <-- "Dee".
Give the final value of second.
What is "Ari"?
Start with left =
"RED" and right =
"Blue". Run left <--
right; right <-- left.
What are the final values?
Both contain "BLUE."
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?
A login system displays "Access Granted." This message serves this role.
What is output?
Explain what the assignment arrow does in message <-- "Welcome".
What is stores "Welcome" in the variable message?
team <-- "Tigers";
saved <-- team; team <-- "Eagles".
Give both final values.
team = "Eagles"; saved = "Tigers"
Why does the two-line swap above fail?
"RED" is overwritten before it is saved.
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?
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?
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"?
first <-- "Ari";
second <-- first;
first <-- "Dee"; third
<-- second; second <-- first.
Give all three final values.
first = "Dee"; second = "Dee"; third = "Ari"
Write three assignments that correctly swap the values of left and right.
temp <-- left; left <-- right; right <-- temp