English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How would I calculate weeks, days, and hours of someone who worked a certain amount of hours per month? A work week is 40 hours and a work day is 8 hours. They give an example of someone who worked 70 hours one month and it ended up to be 1 week, 3 days, and 6 hours. I actually need this for my programming class, so I just need to know what to divide, multiply, or whatever. Thank you.

2007-02-12 16:51:09 · 7 answers · asked by Christi 4 in Science & Mathematics Mathematics

7 answers

You would take the number of hours work and divide it by 40. Remove the whole number (for the number of weeks) and multiply the portion after the decimal by 40 and then divide it by 8 (to determine the number of days). The whole number will be the days worked. Take the portion after the decimal and multiply by 8 to determine the number of hours.

FOR EXAMPLE:

70 divided by 40 = 1.75 (1 weeks)
.75 multiplied by 40 = 30
30 divided by 8 = 3.75 (3 days)
.75 multiplied by 8 = 6 (6 hours)

Hope this helps.

2007-02-12 17:02:24 · answer #1 · answered by johngar 2 · 0 0

Not sure which programing language you are using so I will give you a flow chart. (Take the number of hours) /40 that will give you # of weeks worked. Set you variable so that if there is a remainder it then divides the remainder by 8. This will give you # of days. Set this variable so that if there is still a remainder to take that remainder and show it as hours. Thus if someone worked 90 hours in a month the following will happen 90/40 = 2.25 or 2 weeks and 10 hrs. Then part 2 of your program takes the 10 hours and divides by 8 thus 10 / 8 = 1 2/8 or 1 1/4. Now you have 2 weeks 1 day and 1/4day or 2 hrs Thus 2 weeks 1 day and 2 hours.

2007-02-13 00:58:13 · answer #2 · answered by pjvthatsme 2 · 1 0

I think its easiest to go by the smallest base (the hours).

So lets say, a work week has 40 hours...so 1 week can be totaled to 40 hours. (as in: week x 40 = hours)

Then the days, you can go (days x 8 = hours)

The hours, you can keep the same.

Then you can just add the three total hour calculations to get the total hours per month.

That is to get total hours for the month
__________________

For total days, the equations you would use are :
week x 5 = days (since, there are 40 hours in a week and 8 hours per day, so 40/8=5)

days = days

hours x (1/8) = days

Add those together for days
_________________________

Then for weeks:

weeks = weeks

days x (1/5) = weeks

hours x (1/40) = weeks
_______________
For your case, you total hours would be:

(Week conversion) + (Day Conversion) + (Week Conversion) = Unit Total

You can do by hours:

(1 x 40) + (3 x 8) + (6) = 72 hours

OR you can do it by days:

(1 x 5) + (3) + (6 x (1/8)) = 8.75 days

OR you can do it by weeks:

(1) + (3 x (1/5)) + (6 x (1/40)) = 1.75 weeks

2007-02-13 00:57:32 · answer #3 · answered by disoneguy300 3 · 1 0

in example
total work done in a month, put the values in hrs ( 1 week = 40 hrs ) since it is 8 hrs per day means week is 5 days working.
1 week +3 days + 6 Hrs
= 40 + 40*3/5 + 6
= 40 + 24 + 6 = 70 hrs. hence example given is correct
Therfore make a formula and algorithm for programming purpose
i.e.
Total working hours in a year
= number of years * number of weeks per year * number of days per week * nnumber of working hours per day

2007-02-13 01:00:49 · answer #4 · answered by Mritunjay 2 · 0 0

First divide the number by 40--the integer answer will be the number of weeks; next divide the remainder by 8, the integer answer will be the number of days; finally, what ever is left over, is the number of hours worked on the last day.

2007-02-13 00:55:25 · answer #5 · answered by bruinfan 7 · 0 0

1 week= 40 hours
3 days= 3 days times 8 hours =24 hours
(1day=8hours)

6 hours=6 hours
then you add all
40+24+6=70 hours
ok hopefully this is what you meant, good luck

2007-02-13 01:09:07 · answer #6 · answered by yanira69h 1 · 0 0

1 day has 24 hours, a week 24*7. you can make an array and condition the total hours to be weeks days and hours. For example if you have 28 hours, you ask if number of hours is grater than 24, if positive, you substract 28 - 24, then you have a day.. and the result of the substraction the hours you have to add to the answer

2007-02-13 00:59:42 · answer #7 · answered by black_pepper712 2 · 0 0

fedest.com, questions and answers