Question: Part 4b) There should also be a file called activity4b.py Use this for the following program. Create a simple metropolitan delivery cost calculator for a

Part 4b) There should also be a file called activity4b.py Use this for the following program.

Create a simple metropolitan delivery cost calculator for a new mail and small package courier service in Omaha

1. Minimum cost pick up and delivery of a 2 pounds or less package within Omaha City Limits with a guaranteed delivery time of 2 hours is $7.95

2. Express time of one hour or less adds $2.00 to the delivery price.

3. Add $1.00 for every pound over 2 lbs up to 50 lbs. The company does not accept a single package over 50 lbs.

To do this program you need to define 3 functions: They are

def main():

The main function first calls the display title function which displays the title. Next the main functions requires the user to input the a 2 for 2 hours or less or a 1 for 1 hour delivery or less. They also must enter the weight of the package in pounds. Main then passes the delivery time indicator(1 or 2) and the weight in pounds to the get_delivery_price which uses if, elif, else and calculations to return the correct the total delivery price for the package. The main function then prints the total delivery price and asks if the program should continue. If yes, run the program again or print Bye.

def display_title():

Displays the title of the program when called.

get_delivery_price():

The get_delivery_price function uses if, elif, else and calculations to return the correct total delivery price for the package and returns it to main for printing.

In the command line, the program should look like the diagram below.

Be sure to add try - except to ensure that only valid values are entered.

myvenv) C:\apps\2018F\3900a\pr activity4>python activity4b.py ISOA 4900 Metro Courier Service Delivery Calculator Calculator ckage is for: 2 hour or lesseii per pound star Base delivery of a 1 lb package is $7.95 for a 2 hour or less delivery. Add $2 for a 1 hour or less delivery Enter 2 for 2 hour or less or a 1 for 1 hour or less: 1 Enter weight of package in POUNDS NUMBERS ONLY PLEASE!. $1 per pound starting at 2 lbs up to 50 lbs: 5 Total delivery Price for Package: 13.95 Continue (y)?: y Bye Base delivery of a 1 lb package is $7.95 for a 2 hour or less delivery. Add $2 for a 1 hour or less delivery Enter 2 for 2 hour or less or a 1 for 1 hour or less: 2 Enter weight of package in POUNDS NUMBERS ONLY PLEASE!. $1 per pound starting at 2 lbs up to 50 lbs: 34.5! Total delivery Price for Package: 40.95 Continue (y)?: n Bye myvenv) C:\apps\2018f3900aq\pr activity4>

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!