![](https://static.isu.pub/fe/default-story-images/news.jpg?width=720&quality=85%2C50)
1 minute read
2. Conditions II
Objectives
In this session, student will learn about -
● If-else block
● Else-if block
Keywords
● Conditions: Tell a program to execute different actions depending on whether a certain criteria is true or false
WEBS at a Glance
Recall the concepts covered in the previous coding session
Play the video given in the panel to introduce the concepts to be covered in this session
Discuss if-else and Else-if blocks
Activity given in the panel Solved examples – Q 5.1 and 5.2
Conclude the session Assign the homework
● Instruct: Go to the Panel and open the Lab on Conditions II.
● Play the video given on the panel.
● Discuss the Quiz questions given on the Panel.
● Invite answers from as many students as possible.
● Conduct Solved Examples given in the Pages 32 and 33:
■ Say: Let’s see some examples to understand the If-else and Else-if blocks.
■ Instruct: Click on the Assignment section.
■ Instruct: Click on the Go to Practice button to attempt the activity.
■ Walk around in the classroom and observe the activity done by the students.
■ Instruct: Click on the Yes button to submit the activity.
Note
● If time permits, conduct the additional activity given on the panel.
● Conclude: Today, we learned about the If-else and Else-if blocks.
● Ask the following probing questions:
■ Can you differentiate when to use the if-else block and when to use the else-if block?
Possible Responses: When we have only one condition, we use the if-else block; When we have to check more than one condition and action, we use the else-if block.
■ Why do you think the last else does not require a condition?
Possible Responses: The last else is the last option that will execute whenever the previous conditions are false; If no condition is true, the last else block will be executed.
● Assign the following project as homework:
■ Input marks in English. Check the following conditions – If the marks are more than 90 print a message “Excellent”. If the marks are fewer than 60, print “You need to work harder”. If none of the conditions are true, print “You are doing well. Keep working hard!”
Note
● The project is optional. Assign it if feasible.