The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write a program that asks the user to enter a price for an item and the quantity for that item and calculate the total amount which is then displayed. Remember that the total amount must include the sales tax. Use the New York City rate of 8.75% as the sales tax rate.
2) Categorize the total cost of this item by using the total amount to display Very Costly, Moderately Costly, Costly or Affordable accordingly as follows:
Display Very Costly if the amount is equal to or over $100
Display Moderately Costly if the amount is equal to or greater than $50
Display Costly if the amount is equal or greater than $25
DisplayAffordable if the amount is anything less than $25.
Hints:
( For Extra Credit format output to only show two decimal points )The total including taxes should not have more than two decimal points. For instance a price of 2.25 and a quantity of 22 with the tax included should not yield 53.83125. It should be 53.83. Use something like this:
output = static_cast(output * 100) / 100.0;
or
use the fixed and setprecision(2) stream manipulators (p. 136 example 1). Be sure to include the iomanip include (p. 137 line 5).
The sales tax rate can be defined as a constant in your program and set to 0.0875. Otherwise if it were set to 8.75, you would have to divide it by 100 to convert it to the proper number.
Reference the materials from your chapters as guides, specifically the following:
Figure 4-27 (p. 97)
Figure 4-38 (pp. 111 - 112)
Figure 6-21 version 2 (p.174)
Figure 6-49 (p.198)
Email me the source code file in (.cpp)
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll