Paired Programming Activity
Functions (Familiar Code)

 

Activities

I would like you to complete four Python functions working with your partner.

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. You may make them all in the same file on Replit.

 

 


Func 1

How Far

Wayne Ningmoon teaches middle school science. He is currently teaching a unit on space exploration. He wants your help calculating where the Voyager 1 spacecraft currently is located.

Write a Python function that conforms to the following

 


Func 2

Discount Price

Brice Tagg wants you to create a program to help her calculate sale prices in her store.

Write a Python function that conforms to the following

 


Func 3

The Year of the Panther

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 function that conforms to the following

 


Func 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 function that conforms to the following