Java Payroll System: Calculate Employee Overtime Easily | Complete Tutorial
4K views
Nov 11, 2024
Java Payroll System: Calculate Employee Overtime Easily | Complete Tutorial Source code : https://www.tutussfunny.com/employee-working-hours-calculation-system-using-java/ #JavaProgramming #PayrollSystem #EmployeeOvertime #JavaTutorial
View Video Transcript
0:00
hi friends welcome to tutor funny
0:02
Channel today I'm going to make the
0:03
another program which is a uh gross wage
0:07
calculation system for the payroll
0:09
system of java this is very important
0:12
project for you work with the software
0:14
industrial these are the project that
0:16
you are frequently doing okay so you
0:18
must learn this all the things so here
0:21
you can first read the question act as
0:23
Java developer create the program and
0:25
calculate the gross W for an employee
0:28
number of hours work hourly rate apply
0:33
the following condition okay if the
0:36
employee Works more than 40 hours you
0:38
have to observe this one if the employee
0:41
works for for more than 40 hours they
0:44
are paid an overtime rate this the
0:47
overtime rate they have paid those who
0:49
have work 40 hours they have paid the
0:52
overtime rate 20 rup 20 okay for for the
0:57
hours Works to 40 the normal hourly rate
1:01
is 50 for the hours 40 the normal hourly
1:05
rate is 50 the normal hour rate is 50
1:08
those who are working more than 40
1:12
hours the company provide 20 extra 20
1:15
rupees okay this is your logic okay you
1:18
can apply whatever payment you want you
1:20
want for the while you're doing the
1:22
payroll system okay based on the
1:25
scenario we can Implement our system so
1:27
we already open the net be ID so I'm
1:30
going to make a small
1:33
design Java application
1:37
next here I'm going to implement the
1:41
employee
1:48
per now here we have to make another
1:51
Java frame employee
2:05
panel select this one
2:10
properties this
2:12
one you have to track one label this
2:15
label I'm going to name it as
2:19
employee
2:26
P properties you have to little bit
2:30
bigger the font than usual because this
2:33
is one should be our uh heading so
2:38
properties you have the forr color you
2:40
have to make it as this
2:50
one okay now what I'm going to do is now
2:55
let's do the thing
2:58
is Lay
3:00
this one should
3:02
be uh we have to make it
3:06
asate
3:20
Power properties you have to make this
3:22
little bit bigger of the
3:24
font with
3:28
Bol okay this one I'm going to make the
3:31
color little bit different
3:38
color can use this
3:42
perfect now work now here we have to
3:45
make this one as
3:46
a uh this label I'm contr C copy V rate
3:51
second isly rate
4:04
it after that same third one C copy B
4:08
this one should be we have to do it here
4:11
which is a gross wage we have to
4:13
calculate the gross
4:19
wage okay what I'm going to do see have
4:21
to implement that we have drag the text
4:23
fields
4:33
we have to properties we have we have to
4:35
do it B with
4:39
14 back to remove the X ins set you have
4:42
right here change the variable
4:45
txt H work ja
4:53
work second one text box C to copy V to
4:57
paste over here this one should be
5:01
how
5:10
rate third one should be copy paste
5:15
it txt
5:22
wage okay after that what I'm going to
5:25
I'm going to make the calculation part
5:28
how to calculate the Cal part we need
5:30
one button which is a
5:42
[Applause]
5:45
ccate first what I'm going to do go to
5:47
the source contr
5:51
F the
5:58
UI you make this
6:04
matter select this one control
6:07
properties code generate
6:10
center after that we have to run the
6:15
program again check
6:18
it it's working as we accepted okay now
6:23
what I'm going to rest here I'm going to
6:25
make the validation part so here this
6:27
want little bit increase the font size
6:29
okay it's enough no problem so first
6:33
select the
6:34
button you first select the
6:37
button right click event action action
6:40
perform here what I'm going to do is
6:43
here I'm going to do it the things
6:46
as uh first we have a employee give the
6:50
employee hours employee work hours you
6:53
have to give the employee work hours
6:55
okay so the condition uh employee you
6:59
can again read the condition here
7:02
employee if the employee work more than
7:04
40 hours they will be paid which one 20
7:09
okay others get normal rate as
7:11
50 okay the overtime rate we have to
7:15
calculate so the based on the things we
7:18
have to do the condition
7:20
if if work so we have to create the
7:24
variables first
7:27
double HW workk
7:31
H
7:33
rate how rate H which not H work which
7:36
nothing but nothing but how work how
7:40
work how
7:42
rate how that this one should be over
7:48
time gross
7:53
switch these are
7:55
the variables
8:03
if
8:06
AB more than
8:11
40 we have write over
8:18
time over
8:21
time this over time
8:26
equal ABAB
8:32
-
8:37
40 gross
8:41
wage
8:45
equal
8:47
40
8:51
minus normal
8:57
aate normal will be what's the aate we
9:01
have to put it here normal a is 50 okay
9:05
as the documentation we explain 40 50
9:08
normal a so we have put the normal okay
9:11
after that what I'm going to do is here
9:13
uh 40 sorry what minus
9:16
this okay after that what I'm going to
9:19
do
9:21
is plus when the employee work over time
9:25
so over time we have a what's the
9:27
overtime works over time
9:32
bracket we have to make as a square
9:33
bracket then only we can work
9:36
it you have write over time
9:40
into over time
9:44
into uh over time into a rate a rate is
9:50
20 over time a rate over time rate which
9:54
is we have 20 you can see here
10:03
understand that that's the thing
10:07
okay okay so that's the thing you have
10:09
TR it normal time or
10:13
20 works
10:18
not of you inst like this you
10:23
write that's a good
10:26
B sometime have to work before the
10:29
button here okay so that's why it work
10:32
so how
10:35
else else other are getting normal
10:37
payment so
10:39
the uh the 40 hours of work and 50 of
10:45
the payment they getting 50 of the hour
10:48
rate this are 40 hours 50 of the hour
10:51
rate they are getting normal workers
10:53
okay so these are the things we have do
10:55
it now let's do it the txt wage
11:01
dot set text the text box here we have
11:04
wred the
11:10
double do two
11:13
string so write this cross
11:17
switch that's it now
11:20
let's get the things you can see here
11:24
how how
11:27
work they're working as 40 hours so the
11:31
hour rate is what is the 40 hours hour
11:33
rate 40 hours hour rate the same thing
11:36
okay 40 hours our rate is
11:39
40 this one should if the work the
11:42
employee work 50
11:57
hours what okay okay okay the problem is
12:00
here uh sorry we have we haven't done
12:03
any calculation part that's a problem so
12:06
the hourly work what the problem is here
12:10
dxt we have to assign to this particular
12:13
variable this particular text box we
12:16
haven't you forgot to assign it
12:21
getex
12:23
so once the aate you entered here it it
12:27
take to complete here
12:31
double dot pass
12:33
double dot pass
12:36
double same copy and paste it below this
12:39
one should be
12:41
the
12:43
this
12:49
H our is what you entered here it is
12:53
more than 50 then it's
12:54
calculator the rate here
12:57
here HD
13:02
okay what you entered here based on
13:04
theate here you can see here now it's
13:06
working if the if
13:09
the rate you entered here
13:13
40 if it is this one is 40 it calculate
13:17
based on this if is 50 based on the
13:20
condition is work here it's extra they
13:22
enter the 20 if the more than the
13:26
workers are working more than that
13:30
more than that the normal the
13:33
usual uh working hour hour is 40 per
13:37
week those who are working more than 40
13:40
hours we have provide the a Time based
13:43
on the what time they calculated the
13:46
cross based on the a time how many hours
13:49
they are working the extra time the
13:51
based on the extra time we are
13:52
calculated the S the extra time the each
13:56
hours we are providing the 20 RUP for
13:59
each hour okay so that's what we have
14:02
calculate the prot this is very must
14:04
okay so very important stuff you have to
14:06
just think about that how to make this
14:08
system is very important stuff uh while
14:11
I'm doing the payroll system this this
14:13
is this calculation will be there so
14:15
that I have put into I I have a uh come
14:19
to your mind this kind of a program I
14:20
want to put into my uh Channel this is
14:23
very helpful for student to learn grow
14:26
their programming knowledge thank you
14:27
for watching
#Computer Education
#Java (Programming Language)