Day 5.2 Ex30 Else and If

Here’s my work.
Here’s the link to exercise 30.

Ex30 Code
Ex30 Code
Ex30 Output
Ex30 Output


Study Drill

1. Try to guess what elsif and else are doing.
elsif is like alternative to if. Else is when none of the if and elsif works.

2. Change the numbers of cars, people, and trucks and then trace through each if-statement to see what will be printed.
Different codes from the elsif statement will run.

3. Try some more complex boolean expressions like cars > people || trucks < cars.
Done, like 28-34

4. Above each line write an English description of what the line does.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s