steamengines

Problem 12

Oct 2nd, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.38 KB | None | 0 0
  1. //Christian Ballard
  2. //COSC 1330-003
  3. //Problem 12 Calculates and displays total pay after taxes
  4.  
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     //Declaration
  11.     double hrsWorked = 0.0;
  12.     double payRate = 0.0;
  13.     double fwtRate = 0.0;
  14.     double ficaRate = 0.0;
  15.     double stateIncomeTaxRate = 0.0;
  16.     double grossPay = 0.0;
  17.     double netPay = 0.0;
  18.  
  19.     //Inputs
  20.     cout << "How many hours did you work?" << endl;
  21.     cin >> hrsWorked;
  22.     cout << "What is your hourly pay rate?" << endl;
  23.     cin >> payRate;
  24.     cout << "What is the Federal withholding tax rate?" << endl;
  25.     cin >> fwtRate;
  26.     cout << "What is the Social Security and Medicare tax rate" << endl;
  27.     cin >> ficaRate;
  28.     cout << "What is the State income tax rate?" << endl;
  29.     cin >> stateIncomeTaxRate;
  30.  
  31.     //Calculations
  32.     grossPay = (hrsWorked * payRate);
  33.     fwtRate = (grossPay * fwtRate);
  34.     ficaRate = (grossPay * ficaRate);
  35.     stateIncomeTaxRate = (grossPay * stateIncomeTaxRate);
  36.     netPay = (grossPay - fwtRate - ficaRate - stateIncomeTaxRate);
  37.  
  38.     //Output
  39.     cout << endl << "The Gross Pay is." << endl << grossPay;
  40.     cout << endl << "The Federal Withholding tax is." << endl << fwtRate;
  41.     cout << endl << "The Social Security and Medicare tax is." << endl << ficaRate;
  42.     cout << endl << "The State Income tax is." << endl << stateIncomeTaxRate;
  43.     cout << endl << "The Net Pay is." << endl << netPay << endl;
  44.  
  45.     system ("pause");
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment