NEW
Font size
WorksheetsAP CSP Unit 2 Quiz 1 Review
Total questions: 17
Worksheet time: 10mins
What are the two main ways that algorithms can be designed?
Images or videos
In pseudocode or as a flowchart
By hardware or software
What is pseudocode?
A way of describing a set of instructions in text form
A specific programming language that all computers use
A diagrammatic representation of a set of instructions
What is a flowchart?
A flowchart is a text-based way of designing an algorithm
A flowchart is a specific programming language
A flowchart is a diagram that represents a set of instructions
How are symbols connected together in a flowchart?
Symbols do not get connected together in a flowchart
With lines and an arrow to show the direction of flow
By numbers
makes a and b equal to each other
this code doesn't do anything
rearranges the variables a, b, and tmp.
swaps the values of a and b
This program causes an error
x is equal to 15; y is equal to 15
x is equal to 5; y is equal to 10
x is equal to 15; y is equal to 10
x is equal to "x + 5"; y is equal to "x"
x is equal to 10, 15; y is equal to 5, 10
What is sequencing?
The characters you code in Scratch
A set of instructions carried out in a logical order to complete a task
A loop that makes code go round and round
A variety of coloured blocks that provide coding in Scratch
Selection is...
a list of instructions which are followed in a set order
a list of instructions where there is a choice based on a condition
A list of instructions which will loop based on a condition
A list of instructions which will loop forever
IF is...
sequencing
iterating
selecting
What is an algorithm?
A set of instructions which describe a system
The solution to a problem
A type of programming
Which of the following contains an INCORRECT sequence when getting dressed to go out?
Put on socks, put on shoes, put on coat
Put on coat, put on shoes, put on socks
Put on socks, put on coat, put on shoes
Why is selection important?
Selection allows us to include more than one path through a solution
Selection allows us to repeat steps in a solution
Selection allows us make our solution more efficient
myAge = 12
PRINT "Next year I will be: "
PRINT myAge + 1
PRINT "In two years I will be: "
PRINT myAge + 2
PRINT "In three years I will be: "
PRINT myAge + 3
Iteration
Sequencing
Selection
IF LENGTH( password ) < 8:
PRINT ("Your password is not valid!")
Iteration
Sequencing
Selection
IF (score > 90) AND (score <= 100):
PRINT "You grade is A*"
Iteration
Sequencing
Selection
IF goalsIn == goalsOut:
PRINT "It's a draw"
ELSE IF goalsIn > goalsOut:
PRINT "Player 1 wins!"
ELSE:
PRINT "Player 2 wins!"
Iteration
Sequencing
Selection
Here's an algorithm that sums all of the numbers in a list. Which of the following IS used in this algorithm?
Sequencing
Selection
Iteration
This algorithm uses sequencing, selection, and iteration.
