Write a program that asks the user for the amount of a purchase. Then, use three functions to perform calculations and d
Posted: Sat May 14, 2022 7:52 pm
Write a program that asks the user for the amount of a purchase.
Then, use three functions to perform calculations and display
values:
○ calcStateTax: Calculates and returns the state tax (5%)
of a provided purchase.
○ calcCountyTax: Calculates and returns the county tax
(2.5%) of a provided purchase.
○ displayPurchase: Given a price, it displays the purchase
price, the state sales tax, the county sales tax, the total sales
tax, and the total of the sale (purchase price + total sales
tax)
● Your main function will ask for the price, then call
displayPurchase, which will be responsible for getting the state
and county taxes.
Then, use three functions to perform calculations and display
values:
○ calcStateTax: Calculates and returns the state tax (5%)
of a provided purchase.
○ calcCountyTax: Calculates and returns the county tax
(2.5%) of a provided purchase.
○ displayPurchase: Given a price, it displays the purchase
price, the state sales tax, the county sales tax, the total sales
tax, and the total of the sale (purchase price + total sales
tax)
● Your main function will ask for the price, then call
displayPurchase, which will be responsible for getting the state
and county taxes.