Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Christian Ballard
- //COSC 1330-003
- //Problem 12 Calculates and displays total pay after taxes
- #include <iostream>
- using namespace std;
- int main()
- {
- //Declaration
- double hrsWorked = 0.0;
- double payRate = 0.0;
- double fwtRate = 0.0;
- double ficaRate = 0.0;
- double stateIncomeTaxRate = 0.0;
- double grossPay = 0.0;
- double netPay = 0.0;
- //Inputs
- cout << "How many hours did you work?" << endl;
- cin >> hrsWorked;
- cout << "What is your hourly pay rate?" << endl;
- cin >> payRate;
- cout << "What is the Federal withholding tax rate?" << endl;
- cin >> fwtRate;
- cout << "What is the Social Security and Medicare tax rate" << endl;
- cin >> ficaRate;
- cout << "What is the State income tax rate?" << endl;
- cin >> stateIncomeTaxRate;
- //Calculations
- grossPay = (hrsWorked * payRate);
- fwtRate = (grossPay * fwtRate);
- ficaRate = (grossPay * ficaRate);
- stateIncomeTaxRate = (grossPay * stateIncomeTaxRate);
- netPay = (grossPay - fwtRate - ficaRate - stateIncomeTaxRate);
- //Output
- cout << endl << "The Gross Pay is." << endl << grossPay;
- cout << endl << "The Federal Withholding tax is." << endl << fwtRate;
- cout << endl << "The Social Security and Medicare tax is." << endl << ficaRate;
- cout << endl << "The State Income tax is." << endl << stateIncomeTaxRate;
- cout << endl << "The Net Pay is." << endl << netPay << endl;
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment