Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Attainment 4 - Classroom Activity (Grade 10)

Total questions: 35

Worksheet time: 35mins

Name
Class
Date
1.

Which of the following is used to repeat a code?

a)

IF Else Statement

b)

Else IF Statement

c)

Strings

d)

Loops

2.

How many types of loops are there in Swift Programming?

a)

Two

b)

Three

c)

Four

d)

Five

3.

The syntax shown in the picture is of

a)

For in Loop.

b)

Val in Loop

c)

In Sequence Loop

d)

Val Sequence Loop

4.

How many times the loop which is shown in the image will do repetitions?

a)

1

b)

4

c)

5

d)

6

5.

How many times the loop that is shown in the image will do repetitions?

a)

1

b)

11

c)

12

d)

13

6.

What is the output of the given program?

a)

1 2 3 4

b)

2 3 4 5

c)

2 3 4

d)

1 2 3 4 5

7.

How many times the loop that is shown in the image will do repetitions?

a)

1

b)

2

c)

5

d)

10

8.

What is the output of the given program?

a)

2 4 6 8 10

b)

1 3 5 7 9

c)

1 2 3 4 5 6 7 8 9 10

d)

1 2 3 4 5 6 7 8 9

9.

What is the output of this program?

a)

20 23 26 29

b)

21 24 27 30

c)

29 26 23 20

d)

30 27 24 21

10.

How many times the loop that is shown in the image will do repetitions?

a)

3

b)

4

c)

10

d)

20

11.

How many times code will print ICT?

a)

1

b)

8

c)

9

d)

10

12.

Which of the following codes will print UAE 5 times?

a)

for i in stride(from: 5, to: 5, by: 5)

{

print("UAE")

}

b)

for i in stride(from: 1, to: 5, by: 5)

{

print("UAE")

}

c)

for i in stride(from: 1, to: 5, by: 1)

{

print("UAE")

}

d)

for i in stride(from: 1, to: 6, by: 1)

{

print("UAE")

}

13.

The syntax of loop shown in the image is of

a)

Do While Loop

b)

While Loop

c)

Condition Loop

d)

Body of Loop

14.

How many times the loop that is shown in the image will do repetitions?

a)

1

b)

3

c)

5

d)

6

15.

What is the output of the given program?

a)

1 3 5

b)

0 1 3 5

c)

1 2 3 4 5

d)

0 1 2 3 4 5

16.

If the condition of a while loop is always true, the loop runs for infinite times.

a)

True

b)

False

17.

The number of repetitions done by the loop shown in the program is

a)

3

b)

10

c)

30

d)

33

18.

Which loop tests condition at the bottom of the loop?

a)

While Loop

b)

For Loop

c)

Repeat While

19.

What is the output of the given program?

a)

3 13 23 30

b)

1 3 30

c)

1 3 6 9 12 15 18 21 24 27 30

d)

3 6 9 12 15 18 21 24 27 30

20.

How many times the loop that is shown in the image will do repetitions?

a)

1

b)

5

c)

6

d)

infinite (unlimited)

21.

A loop whose body is executed once before the test expression is checked.

a)

For Loop

b)

Repeat While Loop

c)

While Loop

22.

How many repetitions will be done by the loop shown in the image?

a)

3

b)

7

c)

8

d)

10

23.

What is the output of the program?

a)

3 4 5 6 7 8 9 10

b)

4 5 6 7 8 9 10

c)

3 4 5 6 7 8 9 10 11

d)

4 5 6 7 8 9 10 11

24.

How many times Laptop is printed upon execution of the program shown in the image?

a)

5

b)

6

c)

15

d)

20

25.

How many times Hello is printed when the program shown in the image is executed?

a)

1

b)

5

c)

6

d)

Unlimited (infinite)

26.

How many times Mouse is printed when the program shown in the image is executed?

a)

0

b)

1

c)

7

d)

3

27.

A string is a sequence of characters.

a)

True

b)

False

28.

Three double quotations are required in the start and the end of multi-line strings.

a)

True

b)

False

29.

String concatenation is used to join two or more strings with each other.

a)

True

b)

False

30.

Which of the following is string concatenation operator?

a)

*

b)

&

c)

%

d)

+

31.

How many variables are there in this program?

a)

2

b)

3

c)

4

d)

5

32.

What is the output of this program?

a)

Keyboard + Is + An + Input + Device

b)

25

c)

Keyboard Is An Input Device

d)

Error

33.

Which of the following shows correct declaration of a character variable?

a)

var XP = Character = "W"

b)

Character = "W" = var XP

c)

Character = XP = var "W"

d)

var "W" = Character = XP

34.

What is the output of the code?

a)

4

b)

5

c)

Anker

d)

K1.count

35.

What is the output of the program?

a)

11

b)

12

c)

Control Unit

d)

K2.count