What is Sequence?
Steps carried out one after another.
Which flowchart shape represents a decision?
A diamond.
What is a count-controlled loop?
A loop that repeats a fixed/set number of times.
Which pseudocode command is used to receive data from the user?
INPUT
What is a logic error?
An error where the program runs but produces the wrong result.
What is Selection?
Making a choice using IF/ELSE.
What does the comparison operator >= mean?
Greater than or equal to.
How many times does this loop repeat?
FOR count = 1 TO 5
5 times.
Which pseudocode command displays a result?
OUTPUT
What is a trace table used for?
To track the values of variables as a program runs.
What is Iteration?
Repeating one or more steps using a loop.
Complete this pseudocode:
IF mark >= 50 ___ OUTPUT "Pass" ENDIF
THEN
What keyword is used to move to the next repetition of a FOR loop?
NEXT
Write pseudocode that outputs "Pass" if a score is 40 or more, otherwise outputs "Fail".
INPUT score IF score >= 40 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF
If a = 6 and b = 9, which number is larger?
9
Name the three basic programming constructs.
Sequence, Selection and Iteration.
In an IF/ELSE statement, what happens when the IF condition is FALSE?
The ELSE branch is executed.
Where should the IF/ELSE statement be placed when processing 3 test scores?
Inside the loop, so each score is checked.
Write pseudocode using a count-controlled loop to input 3 test scores.
FOR count = 1 TO 3 INPUT score NEXT count
This program should output the larger number. What is the logic error?
IF a < b THEN OUTPUT a ELSE OUTPUT b ENDIF
The condition is wrong. It should be:
IF a > b THEN
What is a condition in programming?
A statement that is evaluated as TRUE or FALSE.
Is mark > 50 TRUE or FALSE when mark = 50?
FALSE, because 50 is not greater than 50.
What is the final value of total?
SET total = 0 FOR count = 1 TO 5 SET total = total + count NEXT count
15
Write pseudocode that inputs two numbers and outputs the larger number.
INPUT a INPUT b IF a > b THEN OUTPUT a ELSE OUTPUT b ENDIF
Trace the program and give the final output:
SET total = 0 FOR count = 1 TO 5 SET total = total + count NEXT count OUTPUT total
15