NEW
Font size
S
M
L
XL
WorksheetsSST Yr8 - NCCE - Algorithms 2
Total questions: 18
Worksheet time: 9mins
Name
Class
Date
1.
Question 1:
Sam has been asked to improve his program to make it more efficient. What is efficiency in algorithm design?
a)
A: The algorithm is written faster and has no errors
b)
B: The algorithm executes faster and uses less memory
c)
C: The algorithm is developed faster and uses decomposition
d)
D: The algorithm executes faster and uses less iteration
2.
Question 2:
The building blocks of all programming language are Sequence, Selection, & Repetition.
Together, what are these called?
a)
A: Constructs
b)
B: Algorithms
c)
C: Commands
d)
D: Syntax
3.
Question 3:
An algorithm is a set of steps that shows how to solve a problem. Which of the following is NOT used to represent an algorithm?
a)
A: Pseudocode
b)
B: Flowchart
c)
C: Mind-map
d)
D: Structured English
4.
Question 4:
What does the shape below represent?
a)
A: Input/Output
b)
B: Process
c)
C: Decision
d)
D: Terminator
5.
Question 5:
Which pseudocode line includes casting?
a)
A: num = int(num)
b)
B: num = avg(num)
c)
C: num = upper(num)
d)
D: num = floor(num)
6.
Question 6:
A program is needed to output the numbers 1 to 1000.
Identify which of the following can meet this need with the fewest lines of code.
a)
A: for loop
b)
B: while loop
c)
C: If statement
d)
D: do until loop
7.
Question 7:
What does the following flowchart symbol represent?
a)
A: Input/Output
b)
B: Process
c)
C: Decision
d)
D: Terminator
8.
Question 8:
What is the difference between a while loop and a do until loop?
a)
A: A while loop always runs once, whereas a do until loop always runs at least twice
b)
B: A while loop may run forever, whereas a do until loop will always stop after a certain number of loops
c)
C: A while loop always runs once, whereas a do until loop may run forever
d)
D: A while loop may never run, whereas a do until loop always runs at least once
9.
Question 9:
Which of the following loops, if using a counter, does not declare the counter variable inside the loop
a)
A: do until
b)
B: for
c)
C: repeat
d)
D: while
10.
Question 10:
What does the following flowchart symbol represent?
a)
A: Input/Output
b)
B: Process
c)
C: Decision
d)
D: Start/Stop
11.
Question 11:
Which of the following will allow a search process to run faster in a program?
a)
A: Add a choice of searching algorithms
b)
B: Add a filtering algorithm before the search algorithm
c)
C: Add a sorting algorithm before the search algorithm
d)
D: Add a matching algorithm instead of the search process
12.
Question 12:
Identify the correct definition of an array.
a)
A: A named piece of memory that holds one value where the value changes
b)
B: A series of pieces of memory that are accessed using one identifier and that hold the same item of data
c)
C: A named piece of memory that holds multiple values where the value does not change
d)
D: A series of pieces of memory that are accessed using one identifier and each piece holds one piece of data
13.
Question 14:
What is the purpose of a trace table?
a)
A: It is used to record the values of the variables as the algorithm runs
b)
B: It is used to record the values of the constants as the code runs
c)
C: It is used to record the lines of code executed
d)
D: It is used to record the values of the constants as the algorithm runs
14.
Question 15:
Which programming construct tests the values of a variable against different possibilities and only runs one section of code when a condition is met?
a)
A: Selection
b)
B: Construction
c)
C: Repetition
d)
D: Sequence
15.
Question 17:
What is missing from the following algorithm?
a)
A: is y = name[0].UPPER?
b)
B: is name[0] = name[0].LOWER?
c)
C: is name = name[0].UPPER?
d)
D: is y = name[0].LOWER?
16.
Question 18:
When designing a system to accept an input between 1 and 10, what type of check should be used?
a)
A: Length Check
b)
B: Range Check
c)
C: List Check
d)
D: Check Digit
17.
Question 19:
Which of the following is not a way to make pseudocode or program code easier for a human to understand?
a)
A: Quotes for text
b)
B: Adding comments
c)
C: Meaningful identifiers
d)
D: White space
18.
Question 20:
Which of the following is an explanation of why a subroutine makes a program design more efficient?
a)
A: The programmer doesn’t need to comment the code as it’s named
b)
B: The code only needs to be written once, and then is re-used in different places
c)
C: The same variable names can be used in different places in the program
d)
D: The programmer can debug the algorithm easier because they are named
Reset
