Python Write A Program That Asks The User To Enter The Number Of Packages Purchased

100 or more

Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of rhe discount {if any) and the total amount of the purchase after the discount.

6. Shipping Charges

The Fast Freight Shipping Company charges the following rates:

Weight of Package Rate per Pound

2 pounds or less $1.10

Over 2 pounds but not more than 6 pounds $2.20

Over 6 pounds but not more than 10 pounds $3.70

Over 10 pounds $3.80

Write a program that asks the user to enter the weight of a package and then displays the shipping charges,

7. Body Mass Index Program Enhancement

In programming Exercise #6 in Chapter 3 you were asked to write a program that calculates a person's body mass index (BMI). Recall from that exercise that the BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight for their height, A person's BMI is calculated with the formula

BMI = weight X 703 / height1

where weight is measured in pounds and height is measured in inches. Enhance the program so it displays a message indicating whether the person has optimal weight, is underweight, or is overweight, A sedentary person's weight is considered to be optimal if his or her BMI is between 18.5 and 25. If the BMI is less than J 8.5, the person is considered to be underweight. If the BMI value is greater than 25, the person is considered to be overweight.

8. Time Calculator

Write a program that asks the user to enter a number of seconds, and works as follows:

• There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds.

• There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or equal to 3,600, the program should display the number of hours in that many seconds,

• There are 86,400 seconds in a day. If the number of seconds entered by the user is greater than or equal ro 86,400, the program should display the number of days in that many seconds.

+1 0

Post a comment