0% found this document useful (0 votes)
705 views15 pages

ICT Grade 7 Worksheet Chapter 4

Uploaded by

Hasan Hfny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
705 views15 pages

ICT Grade 7 Worksheet Chapter 4

Uploaded by

Hasan Hfny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

WINTERNATIONAL SCHOOLS NATIONAL SCHOOLS

☒ AHIS – Khobar ☐ AHNS-Boys – Dammam


☐ OIS – Khobar ☐ AHNS-Girls – Dammam
☐ JIS – Jubail ☐ AHNS-Boys – Jubail
☐ AHIS – Riyadh ☐ AHNS-Girls – Jubail
☐ AHIGS – Aqrabia ☐ AHNS – Riyadh
☐ AHIS – Yanbu ☐ Ajyal – AHNS

Name:…………………………………… Grade: 7 Section:

ICT Worksheet Chapter 4 (2024-2025)


LESSON - (4.1)
Question 1: Choose the correct answer from the options given:

1. What is the purpose of a conditional structure in programming?

a) To perform a logical test


b) To create a loop
c) To define a variable
d) To store data

2. In Python, what keyword is used to start a conditional structure?

a) if
b) for
c) while
d) def

3. What happens if the logical test in an 'if' structure is False?

a) Commands inside the 'if' block are executed


b) Commands inside the 'if' block are skipped
c) The program terminates
d) The user is prompted again

4. What does the 'else' keyword do in a conditional structure?

a) It defines a variable
b) It provides an alternative action if the 'if' test is False
c) It ends the program
d) It creates a loop
1
5. What is a logical test in programming?

a) A comparison between two values.


b) A mathematical operation.
c) A string of characters.
d) A loop control statement.

6. Which of the following is a relational operator?

a) +
b) –
c) *
d) >

7. In Scratch, which block is used to create a conditional structure?

a) The green "if" block.


b) The orange "repeat" block.
c) The purple "forever" block.
d) The blue "ask" block.

8. What is a conditional structure also known as?

a) Loop structure
b) If structure
c) Sequential structure
d) None of the above

9. Which block starts with the logical test in Scratch?

a) Repeat block

b) Forever block

c) If block

d) Event block

2
10. In Python, which operator is used for the 'equal to' logical test?

a) =
b) ==
c) !=
d) <=

11. When using 'if...else' structures in Python, what must you put at the end of the
logical test?

a) semicolon (;)
b) colon (:)
c) comma (,)
d) period (.)

12. What is the purpose of relational operators in a conditional structure?

a) To loop through a set of commands


b) To compare two values and determine True or False
c) To assign values to variables
d) To output values

13. In Scratch, what happens if the user does not enter 'Y' when prompted in the
conditional structure?

a) The program will still add the numbers.


b) The program will subtract the numbers.
c) The computer will not carry out any commands inside the 'if' block.
d) The program will stop.

14. In Python, which operator is used for the 'not equal to' logical test?

a) =
b) ==
c) !=
d) <=

3
15. What does the following Python code do if the user enters 'Y'?

if answer == "Y":
result = number1 + number2
print(result)

a) It prints the result of subtracting number2 from number1.


b) It prints the result of adding number1 and number2.
c) It prints "Y".
d) It does nothing.

Question 2: State whether the following statements are true or false:

1. A conditional structure in programming is also called an 'if' structure.


2. The result of a logical test can only be True.
3. The commands inside the 'if' structure are executed only if the logical test is True.
4. Indented commands in Python are only carried out if the logical test is True.
5. A logical test can only result in "True" or "False".
6. In Scratch, the "if" block can only have one condition.
7. Indentation is important in Python to define code blocks.
8. The else block is optional in a conditional structure.
9. An if statement can only have one condition.
10. Python uses blocks to define conditional structures.

Question 3: Fill in the blanks with the correct words.

Conditional Logical test If Relational Operator key word

1. The structure begins with the word ‘if’ and then has a__________________.

2. The word __________________ is a python conditional structure.

3. If is a __________________ structure.

4. Logica test uses __________________ to compare the two values.

5. The word if is a Python __________________.

4
Question 4: Answer the Following:

1. What is a conditional structure in programming, and how is it used in Scratch?

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

2. What are relational operators, and how are they represented in Scratch?

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

3. Describe the difference between the 'if' and 'if... else' structures in programming.
How are they implemented in Scratch?

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

4. Write a Python conditional structure that checks if a number is greater than 10 and
prints a message if it is.
________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

5
5. What is the purpose of the else block in a conditional structure?

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

6. How can you combine multiple conditions in a single if statement?


________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

7. What is the importance of indentation in Python?


________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

************************************

6
LESSON – (4.2)
Question 1: Choose the correct answer from the options given:

1. What is a counter loop also known as?

a) Fixed loop
b) Conditional loop
c) Forever loop
d) Infinite loop

2. In Python, what is the command to create a loop that repeats 10 times?

a) for i in range (10)


b) while i < 10
c) repeat 10 times
d) loop 10 times

3. What does the exit condition of a loop determine?

a) How many times the loop runs


b) When the loop will stop
c) What commands are inside the loop
d) The type of loop being used

4. In Scratch, what does the 'forever' loop do?

a) Repeats commands until the program stops


b) Repeats commands a fixed number of times
c) Runs commands only once
d) Does not execute any commands

5. What is a loop in programming?

a) A way to execute a block of code repeatedly.


b) A variable that stores a value.
c) A function that performs a specific task.
d) A conditional statement.
7
6. In Python, what keyword is used to create a counter loop?

a) while
b) if
c) for
d) loop

7. In Scratch, which block would you use for a counter loop that repeats 10 times?

a) Forever block
b) Repeat block
c) If block
d) Start block

8. Which of the following represents incrementing a variable in Python?


a) total = total + 1
b) total - total + 1
c) total = 1 + total
d) Both a and c

9. What is the purpose of an "exit condition" in a loop?


a) To start the loop
b) To stop the loop
c) To count the iterations
d) To initialize variables

10. What does the Python command int(number) do?


a) Initializes the variable number
b) Converts number to an integer
c) Outputs the value of number
d) Checks if number is an integer

8
Question 2: State whether the following statements are true or false:

1. A counter loop in programming repeats a set number of times and then stops.
2. In Scratch, the 'forever' loop will repeat until the program stops.
3. Python uses 'forever' loops as a standard looping structure...
4. In Python, the commands inside a loop must be indented.
5. A counter loop in Python always runs indefinitely.
6. In Python, the variable used as a counter in a for loop must always be named
i.
7. An exit condition is a logical test that determines when a loop stops.
8. A loop counter can be used to control the number of iterations in a loop.
9. The int() function converts a string to an integer in Python.
10. In Python, all commands inside a loop must be indented.

Question 3: Fill in the blanks with the correct words.

Conditional loop Fixed loop Loop Intended Repeat total=total+1

1. A __________________ repeats a set number of times and then stops.

2. _________________ is controlled by a logical test.

3. In Python, a counter loop is called a for_________________.

4. In Python, the command to increase the value of a variable called total by 1

is_________________.

5. In Scratch, the _________________block is used to repeat a set of commands a fixed

number of times.

6. The commands inside a Python loop must be_________________to show they belong to

the loop.

9
Question 4: Answer the Following:
1. What is a counter loop and how does it function in programming?

__________________________________________________________________________

__________________________________________________________________________

__________________________________________________________________________

2. Explain the difference between a counter loop and a conditional loop.

__________________________________________________________________________

__________________________________________________________________________

__________________________________________________________________________

3. What is the purpose of the 'int()' function in Python when dealing with user input?

__________________________________________________________________________

__________________________________________________________________________

__________________________________________________________________________

4. Write a Python program using a counter loop that adds 5 numbers entered by the user
and prints the total.

__________________________________________________________________________

__________________________________________________________________________

__________________________________________________________________________

__________________________________________________________________________

__________________________________________________________________________

__________________________________________________________________________

************************************
10
LESSON - (4.3)
Question 1: Choose the correct answer from the options given:
1. What is a conditional loop controlled by?

a) A fixed number of times


b) A logical test
c) User input
d) Random values

2. When does the loop in scratch stop repeating?

a) The test is False


b) The test is True
c) The user enters '0'
d) The program stops

3. In Python, what is the equivalent of a conditional loop?

a. For loop
b. Counter loop
c. While loop
d. Fixed loop

4. What happens if the condition in a conditional loop is FALSE?

a) The loop will stop


b) The loop will continue
c) The program will crash
d) The loop will restart

5. what keyword is used to start a conditional loop in Python?


a) for
b) while
c) if
d) else
11
6. What is a common mistake when writing a conditional loop in Python?
a) Not initializing the loop counter.
b) Using the wrong logical operator.
c) Not indenting the commands inside the loop.
d) All of the above.

7. What does the != operator mean in Python?


a) Equal to
b) Not equal to
c) Greater than
d) Less than

8. How can you prevent an infinite loop in a conditional loop?


a) Always use a fixed number of iterations.
b) Ensure the loop condition can eventually become false.
c) Ensure the loop condition can eventually become true.
d) Both a and c.

9. What is the key difference between a counter loop and a conditional loop?
a) Counter loops repeat indefinitely, conditional loops do not.
b) Conditional loops repeat a fixed number of times.
c) Counter loops repeat a set number of times, conditional loops rely on a logical test.
d) Counter loops are faster than conditional loops.

10. In Scratch, what block is used to create a conditional loop?


a) Forever block
b) Repeat block
c) Repeat until block
d) If block

12
Question 2: State whether the following statements are true or false:

1. A conditional loop is controlled by a fixed number of repetitions.


2. In Scratch, the loop will repeat until the logical test is True.
3. In Python, the loop stops when the logical test is False.
4. The logical test in a Scratch conditional loop must always use the = operator.
5. A Python while loop requires a colon (:) at the end of the logical test.
6. Indentation is not important in Python conditional loops.

Question 3: Fill in the blank with the correct words.

Conditional loop Counter False while logical

1. The loop will repeat until the test is_______________.

2. In Python a _______________is called a while loop.

3. If you know exactly how many times you want to repeat the commands, use a
___________loop.

4. In Python, the command to start a conditional loop is __________.


5. A Python while loop checks the __________ condition before each iteration

13
Question 4: Answer the Following:
1. Describe how a conditional loop is implemented in Scratch.
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________

2. What mistake in this initial Python program, and how we can fix it?

_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________

3. In your own words, explain when it is appropriate to use a conditional loop in


programming.

_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________

4. What are the three key steps to make a Python program with a conditional loop?
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________

14
5. Describe two common mistakes programmers make when using conditional loops
and how to avoid them.
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
6. Write a Python program where a variable total is set to 100, and the user subtracts
numbers from it until they enter a value greater than 99.
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________

7. Write a short Python program that asks the user for a number and continues to ask
for numbers until the user enters a negative value. The program should then print
the sum of all the entered numbers.
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________

************************************

15

You might also like