What is the answer to the C++ Program??

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.


closed account (zb0S216C)
Build the program and find out. We don't hand out solutions here.

Wazzak
What are you having problems with? Have you tried anything?
this is what i have




#include<iostream>
#include<cmath>
using namespace std;
int main()
{

const double social_security=0.06;
const double federal_income=0.14;
const double state_income=0.05;


const double regular_pay=16.78;
const double union_dues=10;
double overtime_pay;



cout<<"Regular Pay Per Month";
cin>>regular_pay;


overtime_pay=1.5*16.78;
cout<<"Over Time Pay Per Month";
cin>>overtime_pay;


cout<<" Monthly Union Dues";
cin>>union_dues;


cout<<"Social Security";
cin>>social_security;


cout<<"Federal Income";
cin>>federal_income;


cout<<"State Income";
cin>>state_income;






system("pause");
return 0;
}

I really dislike that this is homework but I am a noob at C++ and I need all the practice I can get so this is what I think you are going for.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>


int main()
{
	
	const double federalTax = 0.140;
	const double socialSecurity = 0.060;
	const double stateTax = 0.050;
	
	const double unionFees = 10.00;
	const double 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;
}
Topic archived. No new replies allowed.