Doç. Dr. GÜRAY SONUGÜR

Doç. Dr. Güray SONUGÜR – Öğrenci Bilgi Paylaşım Platformu

Fahranayt – Santigrat dönüşümü

import java.util.Scanner;

public class FahrenaytCelcius

{

            public static void main(String[] args)

            {

                        Scanner derece = new Scanner(System.in);

                        System.out.println(“Lütfen Fahrenheit Değerini Giriniz”);

                        double deger = derece.nextDouble();

                        System.out.println(“Celcius Degeri :\n”+ FahrenheitCelcius(deger));

                        System.out.println(“”);

                        System.out.println(“Lütfen Celcius Değerini Giriniz”);

                        double deger1 = derece.nextDouble();

                     System.out.println(“Fahrenheit Degeri :\n”+ CelciusFahrenheit(deger1));

            }

public static double FahrenheitCelcius (double  deger)

  {

            double Celcius = (deger – 32) / 1.8;

            return Celcius;

  }

public static double CelciusFahrenheit(double deger1)

 {

            double Fahrenheit = (deger1 * 1.8 + 32);

            return Fahrenheit ;

 }

}