Hi
Even I am new to java, a have started learning now. By your post I have tried this code. Just check it out.
Code:
public class Tempreture();
{
private char sc;
private char obssc;
private double tmpdg;
private double cel;
private double fh;
public Tempreture ()
{
sc = 'C';
obssc = 'F';
tmpdg = 0.0;
cel = 0.0;
fh =0.0;
}
public void readInputs()
{
System.out.println("Enter the sc of the degree: ");
System.out.println("Enter the value of the Tempreture: ");
}
public void writeOutputs()
{
System.out.println("The Tempreture degree in" + sc + " is: " + tmpdg);
System.out.println("It equles in" + obssc + ": " + tmpdg);
}
public Tempreture numberOfDegree()
{
return tmpdg;
}
public Tempreture sc;
{
return sc;
}
public static double Celsius()
{
double result = 0;
if (sc == 'C')
tmpdg = cel;
result = ((9(cel)/5)+32);
result = fh;
fh = tmpdg;
return result;
}
public static double Fahrenhiet()
if (sclae == 'F' )
tmpdg = fh;
cel = (5(fh - 32)/9);
cel = tmpdg;
return cel;
}
}
Bookmarks