NEW
Font size
WorksheetsSmall Basic Programming Quiz
Total questions: 15
Worksheet time: 8mins
What is a variable in programming?
A type of loop
A storage location identified by a memory address
A type of function
A control structure
Which of the following is a valid data type in Small Basic?
Integer
String
Boolean
All of the above
What is the purpose of an 'If' statement in programming?
To repeat a block of code
To make decisions based on conditions
To define a function
To store data
Which of the following is a loop structure in Small Basic?
For...EndFor
If...EndIf
Function...EndFunction
Input...Output
What does the following code do? ```smallbasic For i = 1 To 5 TextWindow.WriteLine(i) EndFor ```
Prints numbers 1 to 5
Prints numbers 0 to 4
Prints the number 5
Prints the number 1
How do you take input from the user in Small Basic?
TextWindow.Read()
TextWindow.Write()
TextWindow.Print()
TextWindow.Display()
What will the following code output? ```smallbasic TextWindow.WriteLine("Hello, World!") ```
Hello, World!
"Hello, World!"
Hello World
"Hello World"
Which of the following is a correct way to declare a variable in Small Basic?
var x = 10
x = 10
int x = 10
declare x = 10
What is the output of the following code? ```smallbasic x = 5 y = 10 z = x + y TextWindow.WriteLine(z) ```
15
10
5
50
Which of the following is a basic function in Small Basic?
TextWindow.WriteLine()
Math.Add()
Array.Sort()
File.Read()
What is the result of the following expression: 3×(2+4) ?
18
12
9
6
Which of the following is used to create a loop that continues until a condition is false?
While...EndWhile
If...EndIf
For...EndFor
Function...EndFunction
What is the purpose of a function in programming?
To store data
To perform a specific task
To create a loop
To make decisions
How do you display output to the user in Small Basic?
TextWindow.Display()
TextWindow.Show()
TextWindow.WriteLine()
TextWindow.Output()
What is the output of the following code? ```smallbasic For i = 1 To 3 TextWindow.WriteLine("Hi") EndFor ```
Hi Hi Hi
Hi
Hi Hi
Hi Hi Hi Hi
