Posted By

Dium on 03/31/14


Tagged


Versions (?)

Midterm 6


 / Published in: C++
 

asdf

  1. #include <iostream>
  2. #include <string>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string county = " ";
  10. double sales;
  11. double salesTaxes;
  12.  
  13. cout << "Enter the sales amount: $";
  14. cin >> sales;
  15. cout << "Enter a county (LA/OC): ";
  16. cin >> county;
  17.  
  18. if (county == "Orange")
  19. {
  20. salesTaxes = sales * 0.0725;
  21. cout << fixed << setprecision(2) << endl;
  22. cout << "The tax amount is: $" << salesTaxes << endl;
  23. }
  24. else
  25. {
  26. salesTaxes = sales * 0.0955;
  27. cout << fixed << setprecision(2) << endl;
  28. cout << "The tax amount is: $" << salesTaxes << endl;
  29. }
  30.  
  31. system("pause");
  32. return 0;
  33. }

Report this snippet  

You need to login to post a comment.