WorksheetsAttainment 4 - Classroom Activity (Grade 10)
Total questions: 35
Worksheet time: 35mins
Which of the following is used to repeat a code?
IF Else Statement
Else IF Statement
Strings
Loops
How many types of loops are there in Swift Programming?
Two
Three
Four
Five
The syntax shown in the picture is of
For in Loop.
Val in Loop
In Sequence Loop
Val Sequence Loop
How many times the loop which is shown in the image will do repetitions?
1
4
5
6
How many times the loop that is shown in the image will do repetitions?
1
11
12
13
What is the output of the given program?
1 2 3 4
2 3 4 5
2 3 4
1 2 3 4 5
How many times the loop that is shown in the image will do repetitions?
1
2
5
10
What is the output of the given program?
2 4 6 8 10
1 3 5 7 9
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
What is the output of this program?
20 23 26 29
21 24 27 30
29 26 23 20
30 27 24 21
How many times the loop that is shown in the image will do repetitions?
3
4
10
20
How many times code will print ICT?
1
8
9
10
Which of the following codes will print UAE 5 times?
for i in stride(from: 5, to: 5, by: 5)
{
print("UAE")
}
for i in stride(from: 1, to: 5, by: 5)
{
print("UAE")
}
for i in stride(from: 1, to: 5, by: 1)
{
print("UAE")
}
for i in stride(from: 1, to: 6, by: 1)
{
print("UAE")
}
The syntax of loop shown in the image is of
Do While Loop
While Loop
Condition Loop
Body of Loop
How many times the loop that is shown in the image will do repetitions?
1
3
5
6
What is the output of the given program?
1 3 5
0 1 3 5
1 2 3 4 5
0 1 2 3 4 5
If the condition of a while loop is always true, the loop runs for infinite times.
True
False
The number of repetitions done by the loop shown in the program is
3
10
30
33
Which loop tests condition at the bottom of the loop?
While Loop
For Loop
Repeat While
What is the output of the given program?
3 13 23 30
1 3 30
1 3 6 9 12 15 18 21 24 27 30
3 6 9 12 15 18 21 24 27 30
How many times the loop that is shown in the image will do repetitions?
1
5
6
infinite (unlimited)
A loop whose body is executed once before the test expression is checked.
For Loop
Repeat While Loop
While Loop
How many repetitions will be done by the loop shown in the image?
3
7
8
10
What is the output of the program?
3 4 5 6 7 8 9 10
4 5 6 7 8 9 10
3 4 5 6 7 8 9 10 11
4 5 6 7 8 9 10 11
How many times Laptop is printed upon execution of the program shown in the image?
5
6
15
20
How many times Hello is printed when the program shown in the image is executed?
1
5
6
Unlimited (infinite)
How many times Mouse is printed when the program shown in the image is executed?
0
1
7
3
A string is a sequence of characters.
True
False
Three double quotations are required in the start and the end of multi-line strings.
True
False
String concatenation is used to join two or more strings with each other.
True
False
Which of the following is string concatenation operator?
*
&
%
+
How many variables are there in this program?
2
3
4
5
What is the output of this program?
Keyboard + Is + An + Input + Device
25
Keyboard Is An Input Device
Error
Which of the following shows correct declaration of a character variable?
var XP = Character = "W"
Character = "W" = var XP
Character = XP = var "W"
var "W" = Character = XP
What is the output of the code?
4
5
Anker
K1.count
What is the output of the program?
11
12
Control Unit
K2.count
