time conversion problem

I have wrote a program to figure my weekly hours and figure my bring home pay, however the company I work for has changed our time clocks so instead of 8.67 we get 8.40 (actual time) my program use the 100th of the hour method for figuring time so in another words 8.40 actual time is 8.67 for my programs needs. The calculation for this .40*1.67 then add the hours (i.e. 8) back into the time. Here is my code how can I fix this.

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <iostream>
#include <string>
#include <iomanip>
#include <math.h>

using namespace std;
using std::cout ;
using std::cin ; 
using std::endl ;

//Global Declarations of Variables
double ihoursm = 0, ihourst = 0, ihoursw = 0, ihoursth =0, ihoursf = 0, ihourss = 0, ihourssu = 0, ohoursm= 0, 
ohourst = 0, ohoursw = 0, ohoursth =0, ohoursf = 0, ohourss = 0, ohourssu = 0, iwage = 0, mhours, net_pay,
thours, whours, thhours, fhours, shours, suhours, totalhours, federal, oasdi, medicare, state, retirement = 0,
hvpay = 0, holiday = 0;
int grosspay, hvdays;
string cname ;


int main ()
{
	//Enter Employee Information
	
	cout << "\n\nEnter the employee name = " ;
	cin >> cname;
	cout << "\n\nEnter the time clocked in on Monday = " ;
	cin >> ihoursm;
	cout << "\n\nEnter the time clocked out on Monday = " ;
	cin >> ohoursm;
	cout << "\n\nEnter the time clocked in on Tuesday = " ;
	cin >> ihourst;
	cout << "\n\nEnter the time clocked out on Tuesday = " ;
	cin >> ohourst;
	cout << "\n\nEnter the time clocked in on Wednesday = " ;
	cin >> ihoursw;
	cout << "\n\nEnter the time clocked out on Wednesday = " ;
	cin >> ohoursw;
	cout << "\n\nEnter the time clocked in on Thursday = " ;
	cin >> ihoursth;
	cout << "\n\nEnter the time clocked out on Thursday = " ;
	cin >> ohoursth;
	cout << "\n\nEnter the time clocked in on Friday = " ;
	cin >> ihoursf;
	cout << "\n\nEnter the time clocked out on Friday = " ;
	cin >> ohoursf;
	cout << "\n\nEnter the time clocked in on Saturday = " ;
	cin >> ihourss;
	cout << "\n\nEnter the time clocked out on Saturday = " ;
	cin >> ohourss;
	cout << "\n\nEnter the time clocked in on Sunday = " ;
	cin >> ihourssu;
	cout << "\n\nEnter the time clocked out on Sunday = " ;
	cin >> ohourssu;
	cout << "\n\nEnter holiday or vacation daily pay = " ;
	cin >> hvpay;
	cout << "\n\nHow many holiday or vacation days? = " ;
	cin >> hvdays;
	cout << "\n\nEnter his or her hourly wage = " ;
	cin >> iwage;


	//Determine if hours are greater than 40
	
	{
		//Do Calculations

		float val = 0.00;
		float rounded_down = floorf(val * 100) / 100;
		float nearest = floorf(val * 100 + 0.5) / 100;
		float rounded_up = ceilf(val * 100) / 100;
				
		mhours =  (double) (ohoursm + 12 - ihoursm) ;
		thours =  (double) (ohourst + 12 - ihourst) ;
		whours =  (double) (ohoursw + 12 - ihoursw) ;
		thhours =  (double) (ohoursth + 12 - ihoursth) ;
		fhours =  (double) (ohoursf + 12 - ihoursf) ;
		shours =  (double) (ohourss + 12 - ihourss) ;
		suhours =  (double) (ohourssu + 12 - ihourssu) ;
		holiday =  (double) (hvpay * hvdays) ;
		totalhours = (double) (mhours + thours + whours + thhours + fhours + shours + suhours) ;
		grosspay = ((totalhours * iwage)+ holiday) ;
		federal = (grosspay * 0.04) ;
		oasdi = (grosspay * 0.035) ;
		medicare = (grosspay * 0.012) ;
		state = (grosspay * 0.038) ;
		retirement = (grosspay * 0.05);
		net_pay = (grosspay - federal - oasdi - medicare - state - retirement - 4.50 - 115.89 - 42.02 - 13.98 - 16.35);

	}
		{//Display Employee Details
				
			cout << "\n\n" ;
			cout << "Employee Name............= " <<cname<< endl ;
			cout << "Total Hours ...... = " <<totalhours<< endl ;
			cout << "Gross Pay.........= " <<totalhours * iwage + holiday<< endl ;
			cout << "Net Pay...........= " <<net_pay<< endl ;
		}//End of the Primary Statement

		return 0;


}//End of Int Main 
Topic archived. No new replies allowed.