Question
Create a program that uses a separate module, named CalculationsModule.py, to calculate sales tax and total after tax. This module will need to be imported
Create a program that uses a separate module, named CalculationsModule.py, to calculate sales tax and total after tax. This module will need to be imported into the Main Module. (python)
Console
Sales Tax Calculator ENTER ITEMS (ENTER -99 TO END) Cost of item: 36.99
Cost of item: 29.50 Cost of item: 16.59 Cost of item: -99 Total: 83.08 Sales tax: 4.98 Total after tax: 88.06 Again? (y/n): y ENTER ITEMS (ENTER -99 TO END) Cost of item: 152.50 Cost of item: 59.80 Cost of item: -99 Total: 212.3 Sales tax: 12.74 Total after tax: 225.04 Again? (y/n): n Thanks, bye! |
Specifications
- The main module will get the input from the user, calculate the total of all the items, and print the output as shown in the sample output above. Divide the code in this module into functions that will make the code easier to read and maintain.
- The sales tax rate should be 6% of the total.
- Store the sales tax rate as a constant in the separate calculations module. This module will also contain two functions that (1) calculate the sales tax and (2) the total after tax. The functions will take the total cost of all items as the input argument and round the results to a maximum of two decimal places.
- Add docStrings to this calculations module.
- Assume the user will enter valid data.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started