Question
A fireworks stand sells repeating fireworks for the following prices: 1-5 items, $19.99 each 5-10 items, $17.50 each over 10 items, $14.99 each Write a
A fireworks stand sells repeating fireworks for the following prices:
1-5 items, $19.99 each
5-10 items, $17.50 each
over 10 items, $14.99 each
Write a program that will ask the user how many items they are purchasing, calculate the cost, calculate the sales tax at 7.5% of the total cost and print a receipt to the monitor showing the number of items purchased, the cost before tax, the tax, and the total cost with tax.
Use separate functions to:
Read the number of items from the user
Calculate the cost before tax
Calculate the tax
Print the receipt
Input Validation: Make sure the number of items is greater than 0, if not, print an error message and exit the program.
Please use comments to explain functions used.
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