Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions

Question

What are the functions of top management?

Answered: 1 week ago

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago