Paired Programming Activity
Conditionals

 

Activities

I would like you to attempt to complete four small Python scripts working with your partner.

These problems will be completed using an editor such as Thonny or IDLE and submitted to Autolab for grading.

Please try to make your program output look as much like the example as possible and verify it works with the example input provided. If you have difficulty finding the information or understanding how to approach the problem, you should contact me.

To complete this activity, you will need to create the following functions:

 

 


Cond 1

How old is that doggy in the window?

Canine West works for the Cedar Bend Humane Society.

Conventional wisdom says that one human year is equivalent to 7 dog years.  But it turns out that this is an oversimplification. Veterinarians tell us that it only takes a dog two human years to reach adulthood and then they age much more slowly. They say a more accurate formula is

Write a Python script that conforms to the following

 

 


Cond 2

Is it a Leap Year?

Dr. Cal Lender was just reading up about leap years and he was amazed to find that everything he ever thought about leap year was WRONG. It doesn't actually automatically happen EVERY 4 years.

In fact:

 

Write a Python script that conforms to the following


Cond 3

Zoe Diak is opening a Chinese restaurant.  She decides that she wants to be like most Chinese restaurants and have information about people's birth year and what that means in the Chinese Zodiac.

She reads up on this and discovers that the zodiac cycles one animal per year for every 12 years and then starts over again. In recent years:

** Note, the way it is presented on Chinese Placemats is a simplification because the Chinese (Lunar) calendar and years doesn't line up with the Western (Gregorian) calendar.  If you were born in January or February it is very likely that you were born before Chinese New Year and thus would be part of the year BEFORE you were born. But we are going to follow the Chinese placemat calendar and pretend that the two align.

 

Write a Python script that conforms to the following


Cond 4

Whose Bins? DEEZ Bins!

There is a chain of stores around the US called "DaaBin Store." [Yes, this a real store. There is one in Waterloo, IA]

They buy pallets of merchandise weekly and start new sales every week. Things are priced as follows:

 

 

Write a Python script that conforms to the following