Computational Thinking: Making a quiz program
Create a program to Ask “what is your name?”
Variable Block
● Creating a program to ask a question and tell the answer.
Creating a new variable
1
Ask question & says answer
01.
02.
Logical test - Operators Block
2
Operators Meaning
= Equal to
< Less than
> Bigger than
Example - 5>3 says ‘5 is bigger than 3’ — This test is true.
What about the test 100<50? — ……………………………….
Conditional Structure
A logical test is used to control what the computer does.
● If the test is True, the computer does one thing.
● If the test is False, the computer does a different thing.
If and then block
Program Plan - Let’s see what happens if you give the right answer.
Input Processing Output
3
If then and else Block
Program Plan - Let’s see what happens if you give the right answer and a wrong
answer.
Input Processing Output
4
Activity -01
1. Complete the following incomplete program.
● A fairground ride is only for children older than 6
Here is the program plan.
Input Ask “ What is your age?”
Processing ?
Output Say “You can go on a fairground ride”
5
Hint for processing block —
2. Create the same program for making cat says “you can have a fairground ride”
and “you can't have a fairground ride”
3. Create a program based on following instructions.
Input Ask “Compare 40>10”
Processing 40>10
Output Say “You got it right!” / “You got it wrong!”