Question: Exercise 7 : Dollar Store A store sells all items for $ 1 . Customers buying 1 0 or more items receive a 5 %
Exercise : 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 resultcalcCostcountCalculate the pretax cost,tableCount: an integer for thenumber of itemspurchasedtablePretax total cost of itemspurchased accounting fordiscount if anytabledisplayLinelabelamounttableDisplay one line of theoutput formatted to agiven width and numberof decimal placestableLabel: the label for thedisplayed lineAmount: the amount forthe displayed linetableNone function displaysto screendisplaycost taxtableDisplay net cost, tax, andaftertax amounts usingcalls to displayLinefunctiontableCost: the pretax cost,calculated by calcCost
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
