Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

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:
    • Get the quantity
    • Determining the discount
    • Calculating the full price
    • Calculate discount
    • Calculate the total amount
    • 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
    • The modules/Python files below will be importing into your program.
    • The first module/Python file will contain the $99.00 retail price which is used as a global constant.
    • 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
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education