hi i need a solution on this programming question...
An employee is paid at a rate of $16.78 per hour for regular hours worked in a week. Any hours over that are paid at the overtime rate of one and one half times that. From the worker’s gross pay 6% is withheld for social security tax, 14% is withheld for federal income tax, 5% is withheld for state income tax, and $10 per week is withheld for union dues. Write a C++ program manipulate the above scenario.
// Test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
int main()
{
constdouble federalTax = 0.140;
constdouble socialSecurity = 0.060;
constdouble stateTax = 0.050;
constdouble unionFees = 10.00;
constdouble salary = 16.78;
double hoursWorked;
double overtimeHoursWorked;
double weeksPay;
while(1){
std::cout << "Hello Please enter your hours worked --" << std::endl;
std::cin >>hoursWorked;
std::cout << "Thanks now enter your hours of overtime Worked--" << std::endl;
std::cin >> overtimeHoursWorked;
double grossPay = (hoursWorked*salary)+(overtimeHoursWorked*(1.5*salary));
weeksPay=grossPay-(grossPay*federalTax)-(grossPay*socialSecurity)-(grossPay*stateTax)-unionFees;
std::cout << "THANKS, now let me calculate this" << std::endl;
std::cout << "You are being charged 14% federal tax, 6% for your SS, and 5% for your state!" << std::endl;
std::cout << "Your pay before taxes was " << grossPay << std::endl;
std::cout << weeksPay << " is your total payment for this week! \n" << std::endl;
}
return 0;
}