Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C PLEASE Everyone knows that the first component every theme park needs is a gift shop to aid in revenue. Each of the many

IN C PLEASE

Everyone knows that the first component every theme park needs is a gift shop to aid in revenue. Each of the many gift shops at Universally Comical Funland (UCF) will be equipped with the same type of cash register that needs a small program to make calculations for tourist purchases. For this problem, youll design a program that completes a simple type of transaction. You will ask the user for the price of the item they are buying, the quantity of the item they are buying, and whether or not the item is a taxed item. The users input for the last question will be 0 if the item is NOT taxed, and 1 if it is taxed. The tax rate for UCF should be defined in your program as a constant as follows: #define TAX_RATE 0.065 Note: The intention is to solve this problem WITHOUT an If statement or a Switch statement. Full credit will only be given to solutions that avoid an If and Switch. Also, do not use a For-loop or a While-Loop. Input Specification 1. The item price will be a positive real number less than 100. 2. The quantity of the item purchased will be a positive integer less than 100. 3. The answer to the tax question will be an int, it will either be 0 (no tax), or 1 (tax). Output Specification Output the total cost of the purchase (in dollars) to two decimal places using the format below: Your total purchase will cost $X.XX. Note: the number of digits before the decimal will vary, based on the cost of the purchase, but for dollar amounts, you should always print exactly 2 digits after the decimal. Output Sample Below is one sample output of running the program. Note that this sample is NOT a comprehensive test. You should test your program with different data than is shown here based on the specifications given above. In the sample run below, for clarity and ease of reading, the user input is given in italics while the program output is in bold. (Note: When you actually run your program no bold or italics should appear at all. These are simply used in this description for claritys sake.) What is the cost of the item to be purchased (in dollars)? How many of the item are you purchasing? 10 Is the item a taxed item (1 = yes, 0 = no)? 1Your total purchase will cost $103.84. (Note: Had the user entered 0 for the last question in this example instead, the cost would have been $97.50.)

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

1.Which are projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago