Write a function called delivery_cost that finds the cost of deliver parcel based on its weight and class. Pay attention that the function must be a separate file and can not be part of the calling script. • The script asks the user to enter the weight of the object in pound, and desired class in letter (A, B or C), . Then the script converts lb. to oz. using this formula: 1 lb. = 16 oz. • Then script feeds the weight in oz. and the class in letter to the function. • Function calculates the cost based on the following table • The function prints the result in this format: Your package weights XX lb. and the cost of shipping in class XX is $xx.xx -The script for this problem can be as short as four lines. Rest is in function Class Weight 16 < weight <= 80 oz. $ 1.00 per oz. $2.5 $7.00 A B C 0< weight <= 16 oz. $ 0.75 per oz. $ 2.00 per oz. $5.00 per oz. per oz. per oz. 80< weight oz. $ 1.25 $ 3.00 $ 10.00 per oz. per oz. per oz

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write a function called delivery_cost that finds the cost of delivery of a
parcel based on its weight and class. Pay attention that the function must be a
separate file and can not be part of the calling script.
• The script asks the user to enter the weight of the object in pound, and
desired class in letter (A, B or C),
. Then the script converts lb. to oz. using this formula: 1 lb. = 16 oz.
• Then script feeds the weight in oz. and the class in letter to the function.
• Function calculates the cost based on the following table
• The function prints the result in this format:
Your package weights XX lb. and the cost of shipping in class XX is $xx.xx
• The script for this problem can be as short as four lines. Rest is in function
Class
Weight
16 < weight <= 80 oz.
$ 1.00
per oz.
$ 2.5
per oz.
$7.00
per oz.
A
B
C
0< weight <= 16 oz.
per oz.
per oz.
per oz.
$0.75
$ 2.00
$5.00
80<weight oz.
$ 1.25
$ 3.00
$10.00
per oz.
per oz.
per oz.
Transcribed Image Text:Write a function called delivery_cost that finds the cost of delivery of a parcel based on its weight and class. Pay attention that the function must be a separate file and can not be part of the calling script. • The script asks the user to enter the weight of the object in pound, and desired class in letter (A, B or C), . Then the script converts lb. to oz. using this formula: 1 lb. = 16 oz. • Then script feeds the weight in oz. and the class in letter to the function. • Function calculates the cost based on the following table • The function prints the result in this format: Your package weights XX lb. and the cost of shipping in class XX is $xx.xx • The script for this problem can be as short as four lines. Rest is in function Class Weight 16 < weight <= 80 oz. $ 1.00 per oz. $ 2.5 per oz. $7.00 per oz. A B C 0< weight <= 16 oz. per oz. per oz. per oz. $0.75 $ 2.00 $5.00 80<weight oz. $ 1.25 $ 3.00 $10.00 per oz. per oz. per oz.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education