LESSON 11: Personal Protection and Data Protection

LESSON 10.2: Conditional Concept

In today's class we learned how to use conditionals in both Primary Code and Scratch. But first we are going to make an introduction of what conditionals mean in programming.

In programming, conditionals are the computer's ability to make decisions. We can write commands to the computer to perform actions when a certain condition is true. For children to better understand this concept we can use the metaphor methodology and compare conditionals to exams. When you get more than 5 you have passed the exam and if you get less than 5 you have failed the exam. We can tell the children that the computer can decide whether a grade is a pass or a fail if we introduce these instructions first. 

IF + CONDITION (More than 5) = Show PASS on the screen.

IF + CONDITION (Less than 5) = Display FAIL on the screen.

With the "cooking" methodology we can create a similar metaphor:

IF + CONDITION (More than 5) = Show MAKE OMELETTE on the screen.

IF + CONDITION (Less than 5) = Show BUY MORE EGGS on the screen.

CONDITIONALS WITH SCRATCH

Students can also learn the conditional concept using Scratch. In order to make conditionals in this webpage you need the following blocks, located in the "Control" tab.

To complete the conditionals the student will have to create variables and add values to them. He or she will also have to go to the "operators" tab and drag one to the conditional blocks. After inserting the variable into the operator, the student can choose a result, that is, something that he or she wants the program to do. For example, we can go to looks and choose "Say ___ for X seconds".

In the foll0wing picture you can see an example of the conditionals in scratch. 


Comments