Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function named ship_cost that takes a float package weight and returns an int shipping cost in dollars. Return None if the package cannot

image text in transcribed

Write a function named ship_cost that takes a float package weight and returns an int shipping cost in dollars. Return None if the package cannot be shipped. Write a main program that gets the package weight from the user and calls the function to compute the shipping cost. main then prints to the user either the shipping cost or a message the package cannot be shipped.

I need help writing code in Python. The code needs to be combined for both the question. So one code for both the question. Thank you.

The cost of sending a package by an express delivery service is $15.00 for the first two pounds, and $5.00 for each pound or fraction thereof over two pounds. If the package weighs more than 70 pounds, a $15.00 excess weight surcharge is added to the cost. No package over 100 pounds will be accepted. Write a pro- gram that accepts the weight of a package in pounds and computes the cost of mailing the package. Be sure to handle the case of overweight packages

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

3. What changes should I be making?

Answered: 1 week ago