Check Your Understanding

Now that we are the end of the Conditionals activity, try and answer the questions below.

Conditionals: Exercise 1

Look at the program below that asks the user to enter a secret password, in order to get access to some secret documents.


What will happen when the user answers the question (What's the secret password?) with: 12345?

Conditionals: Exercise 2

A student creates a game and decides that only people aged 5 to 95 are allowed to play it. They create the following stack of blocks.


What will happen if the game player answers the question (What's your age?) with 10? What will happen if the player is aged 4? Or 96?

The student also notices that, regardless of what age the player is, the message: Let's start the game! appears.

The student only wants this message to appear if the player is the right age (aged between 5 and 95) to play the game. To get the blocks to work this way, they will have to move the last say block. Where should the say block be moved?


Views
1 Total Views
1 Members Views
0 Public Views
Share on Social Networks
Share Link
Share by mail

Please login to share this webpage by email.