Вы находитесь на странице: 1из 1

Celsius to Fahrenheit

/*
* Main.java
*
* Created on October 27, 2008, 7:58 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package celstofahr;

/**
*
* @author david johnson
*/
public class Main {

/** Creates a new instance of Main */


public Main() {
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Cels Temp\t\tFahrTemp");
System.out.println("------------------------------------");
for(int celsius=40; celsius>=31; celsius--)
{
System.out.println(celsius + "\t\t\t" + celsToFahr(celsius));
}
}//end of main()
public static double celsToFahr(double cels)
{
double fahr = (9.0/5)*cels + 32;
return fahr;

}//end of celsToFahr()

}//end of main class

Вам также может понравиться