Technology for Learners | Learn to use Technology and use ...
WALT: Use conditional statements if, else if (elif) and elseThe concepts covered in this lesson underpin programming computer games as well as simple forms of artificial intelligence. Explain that we are going to write a short piece of code using conditional statements and comparison operators.Class demonstrationUse the following code as an example:We have declared two variables – name and feeling. Since we have several options in our menu of feelings, we then use another conditional statement called ‘else if’ (written in code as elif). Note that a single equals sign (=) is used to declare variables, whereas a double equals sign (==) is used to provide a different response for the other feelings.Independent work:Can you program a Spanish dictionary that provides the user with a range of English words to choose from and returns the translation in Spanish?Start children off with an example dictionary:For lower ability children, give them a print out of the full solution to follow.Solution:As an extension, children can be asked to complete a different Spanish dictionary or simply add more words to the animal dictionary. ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- when to use i and me correctly
- how to use than and then
- when to use me and someone
- how to use technology in the classroom
- when to use have and has correctly
- how to use your and you re
- when to use then and than
- when to use been and being
- how to use have and has
- when to use has and have grammar
- when to use have and has
- how to use i and me correctly