wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

St Michael's - Year 8 - Advanced Small Basic

Total questions: 33

Worksheet time: 17mins

Name
Class
Date
1.
What is happening in the program?
a)
A program is going to start with 10 sweets and then tell you that they are being eaten, one by one until they are all gone.
b)
A program is going to start with 20 sweets and then tell you that they are being eaten, one by one until they are all gone.
c)
A program is going to give you one sweet for every right answer you enter on a quiz.
d)
A program has 10 sweets and will give them to the first 10 people who finish this test.
2.
When is the program going to stop taking away sweets?
a)
When the variable 'numofsweets' reaches 0
b)
When our stomachs are full.
c)
They will always take away sweets.
d)
When the variable 'numofsweets' reaches 10
3.
What does the code 'ENDWHILE' do in a While Loop?
a)
This shows the end of the code which will be being repeated by the While Loop
b)
This stops the program repeating when it runs.
c)
This starts the While Loop when it runs.
d)
This shows the beginning of the code which will be being repeated by the While Loop
4.
What is the name of the Variable in this program?
a)
numofsweets
b)
sweets
c)
NumOfSweets
d)
MySweets
5.
A piece of code which will keep repeating whilst something is true. This describes...
a)
a While Loop
b)
a For Loop
c)
an If Statement
d)
an Until Loop
6.
How many Sweets does the user start off with in the program?
a)
10
b)
20
c)
15
d)
0
7.
What happens to the sweets in the program?
a)
They get reduced by 1 with every loop of the While Loop
b)
They get reduced by 2 with every loop of the While Loop
c)
They get halved with every loop of the While Loop
d)
They go down to 0 straight away.
8.
If we wanted the user to gain sweets in the While Loop, which piece of code would we change?
a)
Change the '-' to a '+'
b)
Change 'TextWindow.WriteLine()' to 'TextWindow.Read()'
c)
Change 'numofsweets' to 'NumOfSweets'
d)
Change 'numofsweets' to 'addSweets'
9.
Why is TextWindow.Read() not used in this program?
a)
Because the number of sweets are not decided by the user
b)
Because it doesn't matter what number the user picks, it will always be 10
c)
Because the user would not pick a sensible number.
d)
The user can pick a number without using TextWindow.Read()
10.
Why has the programmer chosen to use a While Loop instead of an If Statement here?
a)
Because the While Loop has allowed for the sweets to keep being eaten and an If Statement would only do it once.
b)
It doesn't matter. Either would work fine.
c)
They did use an If Statement
d)
They used a While Loop so that they could get lots of different answers
11.
How could this program be changed so that the number of sweets can be chosen by the user?
a)
You could change 'numofsweets' to =TextWindow.Read()
b)
You could change 'numofsweets' to =TextWindow.WriteLine(2)
c)
You could change 'numofsweets' to =TextWindow.WriteLine("2")
d)
The program already takes the number of sweets from the user.
12.
What is happening in the program?
a)
The day of the week is entered and a decision is made.
b)
You enter Saturday or Sunday
c)
You type on the screen at school or at home
d)
You get told what to do on a day of the week when you type in your name
13.
What is the name of the Variable in this program?
a)
day
b)
DAY
c)
Day
d)
Week
14.
What does the code 'ELSE' do in an If Statement?
a)
This marks the beginning of the code which will be ran if a condition isn't true in an If Statement
b)
This marks the end of the code which will be ran if a condition isn't true in an If Statement
c)
This marks the beginning of the code which will be ran if a condition is true in an If Statement
d)
This marks the end of the code which will be ran if a condition is true in an If Statement
15.
A piece of code which will do different things depending on if a condition is true or not. This decribes...
a)
a While Loop
b)
a For Loop
c)
an If Statement
d)
an Until Loop
16.
Why is TextWindow.Read() used in this program?
a)
To take an input from the user
b)
To print out to the screen
c)
To print out a letter
d)
To write a variable to the screen
17.
Why does the program have each day written with capitals and lower case letters?
a)
To check for both options when they are typed in
b)
To see if people spell them correctly
c)
To stop them working
d)
To make sure the program always works
18.
What happens to the background colour if the user does not enter a valid day?
a)
It turns red
b)
Nothing
c)
It goes green
d)
It turns blue
19.
What does the program say if the user does not pick a valid day?
a)
Invalid Entry
b)
Entry Invalid
c)
Invaluable Entry
d)
Stop
20.
What does the program say if the user enters 'Sunday'?
a)
You should be in school
b)
You should not be in school
c)
Invalid Entry
d)
you should be in school
21.
What does the program say if the user enters 'tuesday'?
a)
You should be in school
b)
You should not be in school
c)
Invalid Entry
d)
you should be in school
22.
What does the program say if the user enters 'WEDNESDAY'?
a)
Invalid Entry
b)
You should not be in school
c)
You should be in school
d)
you should be in school
23.
What does the code 'ENDIF' do in an If Statement?
a)
This marks the beginning of an If Statement
b)
This marks the end of an If Statement
24.
What is happening in the program?
a)
Asking the user to enter their name and then stopping
b)
Asking the user to enter their name and then stopping when they enter the name Shirley
c)
Always saying Hi Shirley
d)
Always saying Goodbye Shirley
25.
What is the name of the Variable in this program?
a)
name
b)
Name
c)
NAME
d)
EMAN
26.
Why is TextWindow.Read() used in this program?
a)
To read in the user's name
b)
To write the user's name to the screen
c)
To start the program
d)
To Read in a number
27.
What do the <> symbols mean?
a)
Does not equal
b)
Equals
c)
Sets a variable to a value
d)
Stops the program
28.
What name is the program looking for?
a)
Shirley
b)
SHIRLEY
c)
Simon
d)
PAUL
29.
What does this line of code do? TextWindow.WriteLine("")
a)
Leaves a blank line
b)
Starts a new line
c)
Tells the program where to start from
d)
Writes the words "When will this end?" to the screen?
30.
Will the program ever end if you do not enter 'Shirley' as your name?
a)
No
b)
Yes
31.
A piece of code which will repeat for each item in a sequence. This describes...
a)
a While Loop
b)
a For Loop
c)
an If Statement
d)
an Until Loop
32.
A piece of code which will keep repeating until a certain condition is met. This describes...
a)
a While Loop
b)
a For Loop
c)
an If Statement
d)
an Until Loop
33.
Before the While Loop begins, what is the user's name set to?
a)
Null
b)
Speech marks
c)
A void
d)
Emptiness