wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Small Basic Programming Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is a variable in programming?

a)

A type of loop

b)

A storage location identified by a memory address

c)

A type of function

d)

A control structure

2.

Which of the following is a valid data type in Small Basic?

a)

Integer

b)

String

c)

Boolean

d)

All of the above

3.

What is the purpose of an 'If' statement in programming?

a)

To repeat a block of code

b)

To make decisions based on conditions

c)

To define a function

d)

To store data

4.

Which of the following is a loop structure in Small Basic?

a)

For...EndFor

b)

If...EndIf

c)

Function...EndFunction

d)

Input...Output

5.

What does the following code do? ```smallbasic For i = 1 To 5 TextWindow.WriteLine(i) EndFor ```

a)

Prints numbers 1 to 5

b)

Prints numbers 0 to 4

c)

Prints the number 5

d)

Prints the number 1

6.

How do you take input from the user in Small Basic?

a)

TextWindow.Read()

b)

TextWindow.Write()

c)

TextWindow.Print()

d)

TextWindow.Display()

7.

What will the following code output? ```smallbasic TextWindow.WriteLine("Hello, World!") ```

a)

Hello, World!

b)

"Hello, World!"

c)

Hello World

d)

"Hello World"

8.

Which of the following is a correct way to declare a variable in Small Basic?

a)

var x = 10

b)

x = 10

c)

int x = 10

d)

declare x = 10

9.

What is the output of the following code? ```smallbasic x = 5 y = 10 z = x + y TextWindow.WriteLine(z) ```

a)

15

b)

10

c)

5

d)

50

10.

Which of the following is a basic function in Small Basic?

a)

TextWindow.WriteLine()

b)

Math.Add()

c)

Array.Sort()

d)

File.Read()

11.

What is the result of the following expression: 3×(2+4)3 \times (2 + 4) ?

a)

18

b)

12

c)

9

d)

6

12.

Which of the following is used to create a loop that continues until a condition is false?

a)

While...EndWhile

b)

If...EndIf

c)

For...EndFor

d)

Function...EndFunction

13.

What is the purpose of a function in programming?

a)

To store data

b)

To perform a specific task

c)

To create a loop

d)

To make decisions

14.

How do you display output to the user in Small Basic?

a)

TextWindow.Display()

b)

TextWindow.Show()

c)

TextWindow.WriteLine()

d)

TextWindow.Output()

15.

What is the output of the following code? ```smallbasic For i = 1 To 3 TextWindow.WriteLine("Hi") EndFor ```

a)

Hi Hi Hi

b)

Hi

c)

Hi Hi

d)

Hi Hi Hi Hi