Concept explainers
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 stepSolved in 5 steps with 2 images
- This is for python, how would i go about doing this?arrow_forwardA manager of a department at Google wants to schedule 15-min coffee chat between two employees every week for his 6 employees. Design and write a program to help this manager. Each employee should have a meeting with a new person. So, no meeting with the same person until they meet all the other colleagues. Use functional programming or object-oriented programing. You can have your own design to cover the requirements but you should consider a design with better time complexity. You can use any data structures (lists, dictionaries, stacks, queues, ...) The number 6 here is an example and imaging there are "n" (an even number) employees in the group (for this example n =6) Every week each employee should have a meeting and just one meeting with one person. Every week they should have a meeting with a new person. Until week 5 ( n-1 weeks) they should have a meeting with the same person. employees = [ employee_1, employee_2, employee_3, employee_4, employee_5, employee_6] It means…arrow_forwardCreate an original multiple-choice question on the topic of Defining and Calling a Function in Python. Include your original question and four original option/answer responses, mark the correct option/answer response with an asterisk preceding it. Do not use "None of the above" as a possible option/answer response. One correct option/answer response per multiple-choice question. Complete the Correct Option/Answer Verification Section with an original explanation as to why the correct option/answer is accurate.arrow_forward
- You must use one other model (math/random).arrow_forwardWrite a program in python for problem 2. Code in python.arrow_forwardPYTHON Code your own Python function to solve Ax=b. Add a documentation string section to be used with the Python function help() function. Demonstrate the function is correctly implemented, and explain your testing approach.arrow_forward
- Please answer quickly in pythonarrow_forwardPrint grid pattern in pythonarrow_forwardIs it better to break up the long programme into smaller modules, each of which carries out a certain function? In the C++ programming language, these portions are called functions. Is there anything more you'd want to say about this?arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education