WorksheetsYear 8 - Unit 2: Small Basic Programming Terminology
Total questions: 10
Worksheet time: 5mins
What is a variable ?
Something that stays the same
A named container for data
A list of a number of items
A table of information
What is an array ?
A selection
A loop
A named container for one item of data
A collection of a number of items of data
When writing code, it is important to remember to make our code easily maintainable. Which of the following help programmers maintain our code in future (you may select more than one answer) ?
giving variables sensible and meaningful names
commenting your code
make the code really complicated and hard to follow
Indenting loops like a paragraph, so we can see where they start and end
Which of the following are important in making sure our code is robust ?
making sure the code runs as inefficiently as possible
making sure the program is very complicated
giving the code a funny filename
using validation
Why is important to use declared variables to set our loops and conditions as opposed to just typing the numbers in ?
There are no variables in code
So we only need to change the value of the variable to change the code's behaviour
You shouldn't do this. It is best to use numbers all the time.
The code won't work unless we declare the variables
What is a collection of data in code that is a little like a table ?
a one dimensional array
a variable
a two dimensional array
an eight dimensional array
Small Basic: In the two dimensional array here - called bookings - what data is at location bookings[1][2] ?
Williamson
Miss
Joseph
Eva
In the bookings array, using Small Basic, what would be the location of Eva Smith's phone number ?
bookings(2)(4)
[4,2]
bookings[4][2]
bookings[2][4]
In Small Basic, what code would be best to overwrite the value for the number of games booked by Joseph Williamson ?
bookings[1][5] = TextWindow. ReadNumber()
bookings[5][1] = TextWindow.Read()
TextWindow. ReadNumber = bookings[1][5]
bookings[1] = Read()
For i = 1 to 10
Is this an example of a count-controlled loop or a condition-controlled loop ?
Count controlled
Condition controlled
