Abel9210

much beginner-tier C++

Feb 25th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. //This program calculates the total due on sales taxes for a quarter period of the year based on the sales and jurisdiction.
  2.  
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. //Named constants
  8. const double Local_Tax_Rate = 0.08875;
  9. const double Credit_Perc = 0.05;
  10.  
  11. int main()
  12. {
  13. //Declaring variables
  14. int Gross, Non_Taxable;
  15. int Taxable;
  16. double Vendor_Credit, Pen_And_Int;
  17.  
  18. //Statements;
  19. cout << "Enter two integers, one for Gross, "
  20. << "one for Non-Taxable: "; //Step 1
  21. cin >> Gross >> Non_Taxable; //Step 2
  22. cout << endl;
  23. cout << "Enter the penalties and interest due at this time: ";
  24. cin >> Pen_And_Int;
  25. cout << endl;
  26.  
  27. cout << "The numbers you entered are " << Gross
  28. << " for Gross Sales and " << Non_Taxable
  29. << " Sales exempt from " << endl;
  30. cout << " Taxes." << endl;
  31. cout << " Penalties and Interest = " << Pen_And_Int
  32. << endl; //Step 3
  33. cout << "The Taxable total of the Sales for this quarter is = " << Gross - Non_Taxable
  34. << endl;
  35. cout << "The pre-tax for this quarter is = " << (Gross - Non_Taxable) * Local_Tax_Rate
  36. << endl;
  37. cout << "The amount to be credited to the vendor for this quarter is = " << (Gross - Non_Taxable) * (Local_Tax_Rate) * Credit_Perc
  38. << endl;
  39. Vendor_Credit = (Gross - Non_Taxable) * (Local_Tax_Rate)* Credit_Perc;
  40. cout << "The final calculation of the sales taxes due is = " << (Gross - Non_Taxable) * (Local_Tax_Rate)+(Pen_And_Int)-(Vendor_Credit)
  41. << endl;
  42.  
  43.  
  44. system("pause");
  45. return(0);
  46. }
Advertisement
Add Comment
Please, Sign In to add comment