What is an algorithm?
An algorithm is a finite, unambiguous sequence of instructions for performing a specific task
Name the type of selection we have looked at
If-then blocks
Name the 2 types of iteration we have looked at
For and while loops
What is a function?
A separated block of code that performs a clearly defined task
What is a list?
A list is a finite sequence of elements, contained within square brackets [ ]
What does p ← 5 mean?
Assign the value 5 to the variable p
What is the basic structure of a if-then block?
What is the basic structure of a while loop?
What is the basic structure of a function?
What does append do?
Adds an element to the end of a list
What are nested loops?
Loops within loops
What is the output?
odd 117
What is the basic structure of a for loop?
How many inputs and outputs can a function have?
One or more inputs
One output
A ← [3, -4, 18, 99]
What is A[3]?
18
What are the 3 mistakes in the following code?
i cannot go from 4 to 2
Assignment arrow is backwards
Should be end for not end if
What is wrong with the following?
missing then
What is the output?
23
What is quotient(47, 4)?
11
What is the output?
[4, 8, 11, 16]
What is wrong with the following code?
If x is positive, an infinite loop is created
What is the output?
hello duck
What is the output?
-1
What is the value of c when count becomes 2?
7/2
What is the output?
x, y, z