Graded Problem Set #2.4
Functions (New Code)

Background

These problems should be completed on your own. Unlike the practice problems, where you are allowed, and even encouraged, to talk about the process with your classmates, these should be attempted on your own. If you have difficulty with these, please reach out to me for assistance or guidance.

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

 

Activities

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:

 


Func G5

Who doesn't buy the unlimited plan?

Fiona Friend is a senior citizen looking at getting a new cell phone carrier. She doesn't use her phone that much so she is looking at a cut rate plan from Geezer Mobile.

The traditional plan from Geezer Mobile includes 90 minutes of air time and 60 text messages each month for only $8.00.

But, if you go over those amount they charge $0.20 for each additional minute and/or $0.10 for each additional text. All cell phone bills include a charge of $0.72 to support 911 call centers. The entire bill (including the 911 fee) is subject to a 7% sales tax

 

Write a Python function that conforms to the following


Func G6

The Dreaded BMI

BMI is one of those things that the medical profession debates whether it is valid and/or helpful. But it seems to kick around still.

This function starts with the code you wrote earlier in the course about BMI

empty

[NOTE: Please use this formula exactly as written. That is, multiply by 703 before you divide.]

but rather than returning the mathematical score, it returns your "category" as taken from the CDC website

Write a Python function that conforms to the following


Func G7

Here I am, stuck in the middle with you

Malcolm has always liked things in the middle. Can you help him find them?

Write a Python function that conforms to the following

 


Func G8

Do I get the loan?

Rob Umblynd is a banker who works in the mortgage department of his bank. He uses the following information to decide if you get a mortgage or not:

  1. The HTI ratio is no more than 0.28 [28%. But for a variety of mathematical reasons we need to use it in the decimal format]
    • HTI is "housing to income" and is the ratio of the expected monthly house payment to the current monthly income
  2. The DTI ratio is no more than 0.36 [Ditto. This is 36% but we need to use it as a decimal]
    • DTI is "debt to income" and is the ratio of all of the expected debts (current monthly debt payments plus expected monthly house payment) to the current monthly income

[Note, this formula and statistics came from https://www.investopedia.com/terms/q/qualifying_ratios.asp]

Write a Python function that conforms to the following