Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. /*Monthly Sales Tax - HW 2
  2. Programmer: Franklin Munoz
  3. Date: 2-20-15
  4. Ver: 1.8
  5. This program will take the month, year and total collected information from user and display the following:
  6. total collected, sales, county sales tax, state sales tax and total sales tax
  7. */
  8. #include<iostream>
  9. #include<cmath>
  10. #include<iomanip>
  11. #include<string>
  12. using namespace std;
  13.  
  14.  
  15. int main()
  16. {
  17.  
  18. // Declare variables
  19. string month, year;
  20. double t, s, c, state, totax;
  21. // Get information
  22. cout << "Monthly Sales Tax\n\n";
  23. cout << "Please Enter Month\n";
  24. cin >> month;
  25. cout << "Please Enter Year\n";
  26. cin >> year;
  27. cout << "Please Enter Total Amount From Register\n";
  28. cin >> t;
  29. // calculate
  30. s = (t / 1.06);
  31. totax = (t - s);
  32. c = (s * 0.02);
  33. state = (s * 0.04);
  34.  
  35.  
  36. //results
  37.  
  38. cout << "Month: " << month << " / Year: "<< year <<endl;
  39. cout << setprecision(2) << fixed;
  40. cout << "--------------------\n\n";
  41. cout << "Total Collected: $" << t << endl;
  42. cout << "Sales: $" << s << endl;
  43. cout << "County Sales Tax: $" << c << endl;
  44. cout << "State Sales Tax: $" << state << endl;
  45. cout << "Total Sales Tax: $" << totax << endl;
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement