Project #4 is a re-writing of Project #2. However, it will now use functions. There are no changes to logic of the program. In other words, donot modify any of the existing code(see the requirements below). The content to complete this assignment is in Chapters(Think Python) 1,2,3,5,6,7(No recursion) and the slides. Software Sales A Software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10-19 20% 20-49 30% 50-99 40% 100 or more 50% Design a program that asks the user the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. New Requirements: Modify Project #2 and convert the respective logic/tasks in the existing program(Project #2) to use functions and modules/Python files.  The logic below should be placed/converted to functions: o Get the quantity o Determining the discount o Calculating the full price o Calculate discount o Calculate the total amount o Printing of the total amount and discount amount  The only logic/code in main() should be user-defined function calls.  There should be at least two modules o The modules/Python files below will be importing into your program. o The first module/Python file will contain the $99.00 retail price which is used as a global constant. o The second module/Python file will contain a “Welcome Shoppers ” heading. An example is below. The heading below needs to contained in its Module and importing into the main source file(.py). Welcome Shoppers. Below is the discount on the product based on the amount you buy: Quantity of 100 or more: 50% discount Quantity of 99-50 items: 40% discount Quantity of 49-20 items: 30% discount Quantity of 19-10 items: 20% discount No discount if it is under 9 items

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

Project #4 is a re-writing of Project #2. However, it will now use functions. There are no changes
to logic of the program. In other words, donot modify any of the existing code(see the
requirements below). The content to complete this assignment is in Chapters(Think Python)
1,2,3,5,6,7(No recursion) and the slides.
Software Sales
A Software company sells a package that retails for $99. Quantity discounts are given according
to the following table:
Quantity Discount
10-19 20%
20-49 30%
50-99 40%
100 or more 50%
Design a program that asks the user the number of packages purchased. The program should
then display the amount of the discount (if any) and the total amount of the purchase after the
discount.
New Requirements: Modify Project #2 and convert the respective logic/tasks in the existing
program(Project #2) to use functions and modules/Python files.
 The logic below should be placed/converted to functions:
o Get the quantity
o Determining the discount
o Calculating the full price
o Calculate discount
o Calculate the total amount
o Printing of the total amount and discount amount
 The only logic/code in main() should be user-defined function calls.
 There should be at least two modules
o The modules/Python files below will be importing into your program.
o The first module/Python file will contain the $99.00 retail price which is used as a
global constant.
o The second module/Python file will contain a “Welcome Shoppers ” heading. An
example is below. The heading below needs to contained in its Module and
importing into the main source file(.py).
Welcome Shoppers.
Below is the discount on the product based on the amount you buy:
Quantity of 100 or more: 50% discount
Quantity of 99-50 items: 40% discount
Quantity of 49-20 items: 30% discount
Quantity of 19-10 items: 20% discount
No discount if it is under 9 items

 

Expert Solution
Step 1

Solution: required code has been provided below along with the output. Comments have been placed in the code to depict the functionality.

Module 1 : for retail price (retail.py)

global retailprice  retailprice = 99

Module 2: Welcome message (welcome.py)

welcome_msg = """Welcome Shoppers.  Below is the discount on the product based on the amount you buy:  Quantity of 100 or more: 50% discount  Quantity of 99-50 items: 40% discount  Quantity of 49-20 items: 30% discount  Quantity of 19-10 items: 20% discount  No discount if it is under 9 items"""
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Computational Systems
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
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