How you live on in this theater you're really going to go ahead and create a project called converter.
OK.
So first we need to create a Java project so click on this file new and then click on Java project.
OK.
And for the project name just type in here converter
OK.
And here you need to click on this finished button here.
OK.
So as you can see here our project is now created.
So we need a class for our project so you can right click on this RC for that.
And then new and click on these class.
OK.
So for the name of our class just type in here converter OK.
And the package name as you know we need to reverse domain here.
So just type in here com that mortiser.
OK.
And at the end of your package name just put your project name.
OK.
Convertors and for the modifiers to the public.
And here check this checkbox that says public static void main method.
OK.
This is going to be our starting point for running our Java code.
OK.
And then click on the swinish button here.
So as you can see here our project is now created.
So first let me actually delete this comment here.
And in order to make this a little area where you are just double click on these converter that Java
tab here.
And as you can see our little area is now much wider and we can write our codes here.
OK
so now I'm going to actually declare.
So the data type of my variable is float.
OK.
And the name of my variable is farenheit.
OK and then I assign a value to my variable here.
For example 65.
OK.
And then at the end of my statement I need to put in a semicolon in order to end my statement here.
OK.
So now you want to output the value of this variable to the concert.
OK.
So just type in here system that out that princeling and then inside Apprentice's you just need to refer
to the name of the variable in order to read its value.
OK.
So at the end of your statement just put in a semi-colon.
And if I run my projects now as you can see it outputs the value of this variable to the concert.
OK.
So the data type of my variable is flawed and it outputs a decimal number here.
OK sixty five point zero.
OK so now we want to convert Fahrenheit into Celsius.
OK.
First we need to subtract 42 from Farenheit value.
OK.
So here in order to subtract first the two from this value.
I just need to refer to the name of my variable for hide.
OK.
And then I put in an assignment operator remember that I told you about this operator here.
This is not an equal operator.
This is an assignment operator OK.
So here I refer to the name of my variable here.
OK farenheit.
OK.
So now in order to subtract 52 from this variable here I just again the first name of my variable OK.
Now I need to put in a minus operator here and then just type in here first through and then putting
in a semicolon at the end of my statement here.
OK.
And here I am subtracting 52 from the value of these farenheit.
Valuable here.
OK.
The value of this Farenheit is 65.
OK.
And then I am assigning the result of this operation here to the Farenheit variable here.
OK so now if I actually output the value of this variable to the console system that out that print.
And then inside Apprentice's I need to refer to the name of my variable.
And then at the end of my statement I need to put in a semicolon.
So if I wrote on my project as you can see the first value that is output to the console is 65.
OK.
Because in this line of code as you can see because when this line of code is executed the value of
this variable is 65.
OK.
And then in line 11 we actually subtract 52 from the value of this variable which is 65 and then we
assign the value of this variable to the left hand side of the operator which is again Farenheit variable.
And here in line first in the food the value of this variable to the console.
OK.
Which is 43 free.
So this is a really important point in assigning values to your valuables.
OK.
So now that we have actually subtracted first the two from Farenheit value and we need to actually divide
the answer by nine.
OK.
So we need to divide this value OK by nine.
So here again I just need to refer to the name of my variable here OK because I want to assign a value
to this variable here.
OK.
And now if you want to divide the value of this Farenheit variable by night.
OK.
So now again I just need to type in here.
Fahrenheit divided by night.
And then at the end of my statement I need to put in a semicolon.
So now if I want to output the value of this variable to the console I just need to type in her system
that out that print line and then inside Apprentice's I just need to refer to the name of my variable.
OK.
So again farenheit.
So I use the autocomplete feature of the eclipse in order to help me to write my name.
OK.
And then at the end of my statement I ended up with a semi-colon.
OK.
So now if I run my project as you can see it's going to output this value to the console.
OK this value is the result of this operation here Farenheit divided by 9.
OK so free divided by nine is equal to this value here.
OK.
So now as you can see in this line of code we actually outputted the value of this variable to the console.
OK.
And finally we need to multiply that answer by 5.
OK.
So now we need to multiply this value by five.
OK.
So again here I just need to type in here farenheit.
I just need to refer to the name of my valuable.
OK.
And again in order to multiply this variable by 5 I just need to refer to the name of my variable farenheit.
OK.
Multiplied by 5.
And then at the end of my statement I need to put in a semi-colon.
OK.
So here if I actually output the value of this variable to the console system the out that print Len
and then inside the prentices I just need to refer to the name of my variable.
And at the end of your statement you need to put in a semi-colon OK.
So if I run my project now as you can see it outputs this value to the console.
OK.
So this value is the result of this operation here.
OK.
We have successfully converted this Fahrenheit value into Celsius.
OK.
I just need to use the plus operator in order to concatenate those variables or text to get that.
OK.
So just putting into double quotes here and then inside the double quotes you just need to type in the
text.
So first I put in a space here and then I just have been here.
Degrees Celsius.
And now if I run my project as you can see it actually the outputs are this value here.
OK this is the Fahrenheit value that is converted to Celsius.
And this is our text that we used here.
OK.
So this is for actually converting Farenheit values to Celsius.
OK.
And now I want to show you how you can convert a Celsius value into farenheit.
OK so first let me actually comment out these lines of code here.
I don't want to execute these lines of code here.
OK.
So here I just need to actually create some space here and then I need to actually declare our Celsius
variable here.
OK.
I want to convert our Celsius value into Farenheit.