Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- const double SOCIAL_SEC = 0.06,FEDERAL_RATE = 0.14,STATE_RATE = 0.05,OVERTIME_RATE = 1.5;
- int hours,NUMBER_DEPENDENTS = 35.00;
- double rate,social,state,federal,netpay,gross
- ,dependents,Union = 10.00,overtime;
- cout.setf(ios::fixed);
- cout.setf(ios::showpoint);
- cout.precision(2);
- do
- {
- cout << "Please Enter a value of salary rate per hours : $";
- cin >> rate;
- }
- while (rate < 10.00 || rate > 20.00);
- cout << endl;
- hours = 0;
- while (hours < 1 || hours > 60)
- {
- cout << "Please Enter a value of the total hours worked: hrs";
- cin >> hours;
- cout << "Please Enter a Number Dependent to You $35.00 per dependents: ";
- cin >> dependents;
- }
- if (hours > 48)
- gross = (48 * rate)+
- (hours-48)*rate*OVERTIME_RATE;
- else
- gross = hours * rate;
- overtime = (hours-48) * rate;
- social = gross * SOCIAL_SEC;
- federal = gross * FEDERAL_RATE;
- state = gross * STATE_RATE;
- dependents = dependents * NUMBER_DEPENDENTS;
- Union = 10.00;
- netpay = gross-(state+federal+social+Union
- +dependents);
- cout << endl << endl
- << "_______________________________\n"
- << " * \tPAYROLL\t ***\n "
- << "______________________________\n"
- << "Hourly Rate : \t " << rate << endl
- << "Hours Worked : \t " << hours << endl
- << "Over Time : \t " << overtime << endl
- << "Gross Pay : \t " << gross << endl
- << "Social Sec : " << social << " at " <<
- SOCIAL_SEC << endl
- << "Federal Tax : \t " << federal << " at " <<
- FEDERAL_RATE << endl
- << "State Tax : \t " << state << " at " <<
- STATE_RATE << endl
- << "Dependents : \t "<< dependents
- << endl
- << "UNION Dues : \t " << Union << endl;
- cout << "_______________________________\n";
- cout << "Net Pay: \t " << netpay <<endl;
- cout << "_______________________________\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement