Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Dollar Store A store sells all items for $ 1 . Customers buying 1 0 or more items receive a 5 % discount. Additionally, there
Dollar Store
A store sells all items for $ Customers buying or more items receive a discount. Additionally, there is sales tax. Write a program that prompts the user for the number of items purchased, and calculates the total cost before and after tax. Here is an example session:
Enter number of items:
Net Cost:
Tax:
After tax:
As part of your program, define and use these functions:
tablefunctiondescription,Input arguments,Returned resultcalccost countCalculate the pretax cost,tableCount: an integerfor the number ofitems purchasedtablePretax total cost ofitems purchased,accounting fordiscount if anytabledisplayLinelabelamounttableDisplay one ine of theoutput formatted to agiven width and numberof decimal placestableLabel: the labelfor the displayedlineAmount: theamount for thedisplayed linetableNone functiondisplays to screendisplaycost taxtableDisplay net cost, tax, andaftertax amounts usingcalls to displayLinefunctiontableCost: the pretaxcost calculatedby calcCostTax: the taxtableNone functiondisplays to screen
Technically, the function returns the special Python value None.
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