Python
Python
Description
Write a program that asks the user to enter a number of quarters, dimes, nickels and pennies
and then outputs the monetary value of the coins in the format of dollars and remaining cents.
Your program should interact with the user exactly as it shows in the following example:
File Name
counter.py
Description
Write a program that asks the user to enter an amount of money in the format of dollars and remaining
cents. The program should calculate and print the minimum number of coins (quarters, dimes, nickels
and pennies) that are equivalent to the given amount.
Hint: In order to find the minimum number of coins, first find the maximum number of quarters that fit
in the given amount of money, then find the maximum number of dimes that fit in the remaining
amount, and so on.
File Name
coins.py
Score
# of dollars: 2
# of cents: 37
The coins are 9 quarters, 1 dimes, 0 nickels and 2 pennies
BMI Metric Lab
Description
Body mass index (BMI) is a number calculated from a person’s weight and height.
According to the Centers for Disease Control and Prevention, the BMI is a fairly
reliable indicator of body fatness for most people. BMI does not measure body fat
directly, but research has shown that BMI correlates to direct measures of body fat,
such as underwater weighing and dual-energy X-ray absorptiometry. The formula
for BMI is
Weight/Height2
Write a program that prompts for metric weight and height and outputs the BMI.
File Name
bmimetric.py
Description
Body mass index (BMI) is a number calculated from a person’s weight and height.
According to the Centers for Disease Control and Prevention, the BMI is a fairly
reliable indicator of body fatness for most people. BMI does not measure body fat
directly, but research has shown that BMI correlates to direct measures of body fat,
such as underwater weighing and dual-energy X-ray absorptiometry. The formula
for BMI is
Weight/Height2
Write a program that prompts for weight in pounds and height in inches,
converts the values to metric, and then calculates the BMI.
Note: 1 pound is 0.453592 kilograms and 1 inch is 0.0254 meters.
For example, an execution could look like this:
Please enter weight in pounds: 135
Please enter height in inches: 71
BMI is: 18.8284697141
File Name
bmiimperial.py
Write a program that computes the cost of a long-distance call. The cost of the call is
determined according to the following rate schedule:
• Any call started between 8:00 A.M. and 6:00 P.M., Monday through Friday, is
billed at a rate of $0.40 per minute.
• Any call starting before 8:00 A.M. or after 6:00 P.M., Monday through Friday, is
charged at a rate of $0.25 per minute.
• Any call started on a Saturday or Sunday is charged at a rate of $0.15 per
minute.
The input will consist of the day of the week, the time the call started, and the length
of the call in minutes.
The output will be the cost of the call.
Notes:
1. The time is to be input as 4 digit number, representing the time in 24-hour
notation, so the time 1:30 P.M. is input as 1330
2. The day of the week will be read as one of the following three character string:
‘Mon’, ‘Tue’, ‘Wed’, ‘Thr’, ‘Fri’, ‘Sat’ or ‘Sun’
3. The number of minutes will be input as a positive integer.
File Name
callcoster.py