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
Project #4 is a re-writing of Project #2. However, it will now use functions. There are no changes to logic of the
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
Step by step
Solved in 5 steps with 2 images