Question: Please help me write this in codeblock C, thank you: You will ask the user for the price of the item they are buying, the
Please help me write this in codeblock C, thank you:
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 the shop 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 a 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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
