0:00
Hi friends, welcome to tutor funny
0:02
channel. Today I'm going to teach the
0:06
how to build the water calculation
0:08
system using Java. So this system you
0:11
have to make before making
0:14
uh you have to consider this following
0:16
conditions. Okay, these are the
0:18
condition. The water will cost
0:20
1 point per liter that can be used use
0:27
Okay 50 is below 50 lit we can 1.5.
0:34
100 L you have to write as a 2 point per
0:38
liter. Okay this is the price two per
0:40
liter. If it is more than 100 liter it's
0:44
provide it cost you 3 point per
0:49
one liter. Okay this this how the uh
0:52
technology will be working. So, so you
0:55
can see now I'm going to run this
0:57
system. You click on it.
1:05
here 40 will be the total. Okay. This
1:08
how we have calculate the system. This
1:10
is we have completely we have to make as
1:12
a object oriented face. Okay. So let's
1:23
this is the code select code is there
1:25
you can see I'm going to go to project
1:30
chant application next
1:43
this project I'm going to
1:46
name it first I'm going Uh so the thing
1:49
is you have to go along with this
1:55
this name you have to put it over water
1:56
calculator uh you have right right click
1:59
new autoate this a class
2:03
this class what you can do is I'm say if
2:06
you write this once step by step take
2:08
too much of time just copy and paste it
2:10
I will explain the code don't so you
2:15
method which is static method okay you
2:17
can make it as a static method method we
2:18
can directly will be fetching. Okay. So
2:21
here static double this is a data type
2:23
double calculate bit. Okay. You passing
2:26
the argument as consumption. Okay. So
2:29
here it is a double data rate is uh
2:36
consumption the consumption rate as less
2:42
can write the rate will be 1.5.
2:45
If the consumption rate below 100
2:52
if it is more than 100 mean it is
2:56
calculated as three. Okay. So more than
2:59
100 mean it is it may be 2,00 or 3 300
3:03
or 400 all the things calculated as per
3:07
liter three. Okay. This how that system
3:10
will be back. The separate class we have
3:12
made in Java. This one made for the
3:15
purpose of the conditions. The condition
3:17
we are making for the include the
3:18
condition base. You have to put it this
3:21
we have to implement this class. Simple
3:23
class you have implemented for the
3:24
condition. This how we have do the
3:27
things you have to base the condition.
3:30
You have to make the conditions
3:32
implement the conditions
3:35
right. So implement the conditions.
3:37
Right? So what I'm going to do is after
3:39
that you make the GI part as well
3:44
Java Java now this time
3:53
this water whatever name you can wait I
3:55
just put the water this is a frame this
3:57
frame you have to write uh you have to
4:00
if you want you have to write some
4:02
styling part you have direct this this
4:09
Maybe there's some some
4:13
type. So this one should be so
4:15
background background color you put like
4:20
foreground color get like this. This one
4:27
Okay. You have to make the style label.
4:40
inventory or something like that.
4:49
font. We have to align bold 18 or 24.
4:54
Right? So let's make the size little bit
4:58
Right click properties. You have to
5:00
write the foreground color as white.
5:04
White for now let's drag the button.
5:07
This one you have to make this one as a
5:47
Right click properties. Remain this one
5:53
Right click. Edit text. Back space to
5:55
remove the exist. Again, select change
6:00
This one you have to make it this one as
6:01
a what are the things you have made? Put
6:03
it here. Uh txt conception.
6:08
Conception. Conception. Let me have a
6:16
Simply you write that label. This one
6:18
you write as a leader.
6:23
Click on it. Now it is
6:39
Same text control C to copy. Ctrl V to
6:41
paste. Get the copy. This one you have
6:44
to put it here as bill. Okay. You have
6:49
Uh you simply you have to what's you
6:51
have to put it here. So I'll give you
6:53
this cover. You'll be able to be you
6:56
have to write the total bill.
7:02
Okay. That's that's this one you have to
7:07
Princally the size that bigger because
7:09
the uh this is must the UI design is
7:15
when you show the customer they are not
7:17
show the course the front end
7:20
design should be the perfect everyone
7:23
look at the design first. Okay. So you
7:26
have to make the design very well. That
7:29
is a very important stuff while when you
7:32
are doing the system and all just you
7:34
have to consider this one. You have to
7:35
focus on this one. You very you have to
7:38
the people are not focusing on this one.
7:40
Only focus on the coding that is not
7:42
good. Okay. First first of all you have
7:44
to focus on this one. This is very
7:51
Click on it. Right click properties
7:54
border. You have to select the bevel
7:56
border. That is that is that would be
7:58
fine. Fine. So drag one button. This
8:00
button you have to name it as calculate.
8:10
right click properties
8:18
click on it that button here also simply
8:22
you have write it this is not you are
8:24
you think think me as wrong don't think
8:26
me as wrong because I'll be explain this
8:29
one because I have to if you are not I'm
8:32
writing this code and do take too much
8:34
of time that's why I'm doing like this
8:36
way so that this this label I'm to name
8:44
change the name as LBL so that so what
8:47
I'm going to do is if you click on
8:48
double click on that button it goes to
8:50
that particular page so what I did here
8:53
is you have to put the try and catch
8:54
block okay so what I did here is here
8:59
first you have to write this text box
9:02
first you have this text box txt
9:04
conception. Okay, this conception you
9:08
have to this one convert as a double
9:11
because the when you when you calculate
9:13
it as a water calculation part
9:16
conception you have to calculate you
9:19
can't calculate as a string data type
9:20
that is we use for the string type if it
9:23
is in also it's not possible if it is go
9:25
along with the double that is a very
9:27
efficient to make the calculated
9:29
calculation part as well so that we I
9:31
have decided to get as a double data
9:34
okay double when you Write the double.
9:36
You can't write directly. You have write
9:38
double dot pass double. This are this
9:41
this how you convert the text box.
9:43
Default it come as a string format. Once
9:46
you enter the number number uh pointing
9:49
values you you must convert them as a
9:52
double or integer as well. Okay. At the
9:55
at this example according to this
9:58
example we have to rather than we have
10:00
using integer we have to go along with
10:03
double that is good. So I have written
10:05
here as a double. What is the conception
10:08
we have to written over? It is assigned
10:10
to the variable on conception on the
10:12
left side. Okay. So what is the value or
10:14
type on your right side? Sorry.
10:18
Uh your right side it it is simple. It
10:20
is assigned to your left side. Okay. So
10:23
what is the consumption rate you are
10:25
given it assigned to here. Right? So
10:27
here another one is a bill calculation
10:29
part. You have to create the variable
10:30
bill. Auto calculator mean this is a
10:32
class we have created separately the
10:35
this class which has a method called
10:38
calculate bill. Okay. What is the value
10:40
your conception you have you are typing
10:43
over here is simply you are passing here
10:44
as argument. Okay. This passing as
10:47
argument. Okay. This is a this is a
10:49
method. Okay. This is method passing the
10:52
argument. This goes over here.
10:58
Okay. This class has a method called
11:00
which is calcul calculator it getting
11:03
that value what is here is 30 it is
11:07
coming to checking the condition if the
11:10
30 is belongs to this condition
11:13
it is execute it it will be calculated
11:17
okay if it is calculated of this rate if
11:20
it is belongs to this calculate of this
11:22
if it is belongs to this it's calculated
11:24
of this after that finally it will be
11:26
calculated if it is this condition is
11:28
true. It is coming at what is the
11:30
confirmation rate of this along with
11:33
what is the uh value you entered here.
11:35
It it is calculate both and it is return
11:40
return back to this return back to here.
11:43
disappear it's coming to here return
11:45
back to here it is it has been printed
11:48
and we can get the code that is then it
11:50
will be return this this how we have
11:52
written the values when you have put the
11:56
if you are using the return
11:58
keyword you have to using your make it
12:01
as double or data you have to put the
12:04
data in front of the method you you must
12:06
use the then only it should work
12:08
otherwise it won't work okay this is a
12:13
you are implementing for your project.
12:16
Okay, once you do the project, you have
12:17
to do some this classes separately. You
12:19
have to maintain with the class that is
12:21
very important stuff while you are when
12:22
you are working with some other interest
12:25
project that is a must. Okay, don't go
12:27
inside the project everything that is
12:29
not a good thing for you. Okay, please
12:31
learn this thing. This is very must.
12:33
Okay, I have attached the video
12:34
description all the course and all you
12:36
can go along with and study and uh
12:39
bright future. Thank you.
12:44
Okay. Right now I I haven't run the
12:46
program yet. Okay. So you right here. So
12:49
here another one we didn't do. Sorry. UI
12:52
design also. We haven't changed the UI
12:54
design. Okay. Metal.
13:00
This one also. Right click the frame
13:03
code center. When you run the program,
13:06
it should be come as a center screen.
13:11
So what happen is here we have to simple
13:15
so we have to okay we don't need this
13:17
one total bill we don't need only the
13:21
rupees calculation is
13:31
right thank you for watching