Question: All this needs to be written in Python, no other programming language is valid for the question. Thank you for the help. A. (15 points)

All this needs to be written in Python, no other programming language is valid for the question. Thank you for the help.

 All this needs to be written in Python, no other programming

language is valid for the question. Thank you for the help. A.

(15 points) Body Mass Index Write a Python function named BMI that

takes as input a person's weight in pounds as a float and

A. (15 points) Body Mass Index Write a Python function named BMI that takes as input a person's weight in pounds as a float and their height in inches as a float, and returns their BMI result as a float. Note: 1 pound is 0.4536 kilograms, and one foot is 0.3048 meters. A person's BMI is defined as their body mass in kilograms divided by the square of their height (in meters). An example execution is: >>>print ("The BMI is:" + BMI (150,70)) The BMI is 21.522901566123153 You may assume that the weight in pounds and height in inches used to test your function will be positive integers. B. (15 points) Spare Change Write a function named makechange that takes a single argument of a fractional number of dollars. Your function should return a string that reports the collection of the minimum number of coins possible that equals that amount of money. Note: 1 Dollar is worth 100 cents. 1 Quarter is 25 cents, 1 Dime is 10 cents, 1 Nickel is 5 cents, and 1 Penny is 1 cent. An example execution is: >>>print (makeChange (.33)) Quarters: 1, Dimes: 0, Nickels: 1, Pennies:3' You must match this output format exactly, with the only difference being the number of quarters, dimes, nickels, and pennies for the given output. You may assume that the amount of dollars given as an input will be a valid floating point number with no fractional cents. C. (15 points) Taxation Write a function called tax that takes as a single integer argument of the amount of income earned in a year, and returns as a float the taxes owed. Use the following tax scheme: | 10% tax Portion of income up to and including $9,525 Portion of income between $9,526 and $38,700 (inclusive) Portion of income between $38,701 and $82,500 (inclusive) Portion of income after $82,500 12% tax 22% tax 24% tax Return a float that is rounded to two digits. An example execution is: >>> print (tax (4000)) 400.0 >>>print (tax (53123)) 7626.56 You may assume the inputs used to test your function are non-negative integers D. (15 points) Pythagorean Triples A Pythagorean triple is a set of three positive integers a, b, and c that satisfy the relationship a bc. For part D write two functions. The first is called pairInTriple, which takes as input two numbers and returns True if the numbers are part of a Pythagorean triple, and returns False otherwise Secondly, write a function called maxofTriple, which takes as input one number, and returns True if the number is the maximum value in some Pythagorean triple, and returns False otherwise. An example execution is: >>> print (pairInTriple (3,5)) True >>> print (pairInTriple (3,4)) True >>> print (pairInTriple (7,5)) False >>> print (maxOfTriple (12)) False >>> print (maxOfTriple (13)) True You may assume the inputs used to test your function are valid integers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!