What does the following line of code do?
SET result TO a * 5
Multiplies whatever is in the variable called 'a' by 5, and then stores the answer in a variable called 'result'
Adds whatever is in the variable called 'a' to 5, and then stores the answer in a variable called 'result'
Takes whatever is in the variable called 'result' and multiplies it by 5
Which of the following lines of code would divide one variable by another variable and store the answer in another variable?
SET result TO a ^ 5
SET result TO a/b
SET a/5 TO result
If you ran the following piece of code what value would be stored in the variable called 'answer'?
SET answer TO 10/5
2
15
50
What does this code do?
RECEIVE mark FROM (INTEGER) KEYBOARD
IF mark ≥ 50 THEN
SEND “You passed, well done” TO DISPLAY
ELSE
SEND “Sorry, try again, you did not pass” TO DISPLAY
END IF
Gets a mark from the user, and then if the mark is less than 50 it tells them they've passed. Otherwise it tells them they've failed
Gets a mark from the user, and then if the mark is greater than or equal to 50 it tells them they've passed. Otherwise it tells them they've failed
Gets the user to enter their score and then it will work out the grade they get
If we have a piece of code that uses iteration, what does this mean?
You are making a selection with the code
It is entering a value into a variable
It repeats something a number of times
What is a count-controlled/fixed loop?
A loop that will run a piece of code until a certain criteria is met.
A loop that will run a piece of code a set number of times.
A loop that will only run a piece of code if you enter the word 'count'.
Which of these programming constructs would NOT allow you to loop code?
For statement
If statement
While statement
This piece of code is an example of what?
SET shoe_size TO 9
Deleting a variable called 'shoe size'
Ordering a size 9 shoe for you
Assigning a value to a variable
Programs do things in order and the order is made up of three steps. What step is missing below?
Input, process, ----------?
Output
Completion
Download