0% found this document useful (0 votes)
2 views4 pages

Python

The document outlines several programming labs including a Coin Counter Lab, Coin Converter Lab, BMI Metric Lab, BMI Imperial Lab, and Call Cost Calculator Lab. Each lab requires the creation of a program that interacts with the user to perform specific calculations related to coins, body mass index, and call costs based on given parameters. Example inputs and outputs are provided for each lab to illustrate the expected functionality.

Uploaded by

kartik0503
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Python

The document outlines several programming labs including a Coin Counter Lab, Coin Converter Lab, BMI Metric Lab, BMI Imperial Lab, and Call Cost Calculator Lab. Each lab requires the creation of a program that interacts with the user to perform specific calculations related to coins, body mass index, and call costs based on given parameters. Example inputs and outputs are provided for each lab to illustrate the expected functionality.

Uploaded by

kartik0503
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Coin Counter Lab

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:

Please enter the number of coins:


# of quarters: 20
# of dimes: 4
# of nickels: 13
# of pennies: 17
The total is 6 dollars and 22 cents

File Name

counter.py

Coin Converter Lab

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

There are five tests each worth 2 points

For example, an execution should look like this:


Please enter the amount of money to convert:

# 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

Where weight is in kilograms and height is in meters.

Write a program that prompts for metric weight and height and outputs the BMI.

For example, an execution could look like this:


Please enter weight in kilograms: 50
Please enter height in meters: 1.58
BMI is: 20.0288415318

File Name

bmimetric.py

BMI Imperial 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

Where weight is in kilograms and height is in meters.

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

Call Cost Calculator Lab

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.

For example, an execution could look like this:

Enter the day the call started at: Fri


Enter the time the call started at (hhmm): 2350
Enter the duration of the call (in minutes): 22
This call will cost $5.50

File Name

callcoster.py

You might also like