Program Java : Latihan 12 Konversi Suhu dari Celcius ke Reamur ,Farenhait dan Kelvin

Hello disini saya akan membuat Coding Konversi Suhu dari Celcius ke Reamur ,Farenhait dan Kelvin. Denan menggunakan InputanScanner .
Mari kkita coba dalam contoh program…

Contoh Program Konversi Suhu

Silahkan buat class baru bernama Lt20_MenghitungSuhu, kemudian ikuti kode berikut:

import java.util.Scanner;
public class Lt20_MenghitungSuhu{
    public static void main (String[]args){
        double c,r,f,k; //variabel
   Scanner input = new Scanner(System.in);
        System.out.print("Masukan Bilangan = ");
          c = input.nextInt(); //input suhu Celcius
          r = c*4/5; // rumus reamur
          f = (c*9/5)+32; //rumus farenfait
          k = c+273.15; //rumus kelfin
        System.out.println("  ");
        System.out.println("Celsius = " +c);   //
        System.out.println("Reamur = "+r);     //Hasail dari rumus
        System.out.println("Fahrenheit = "+f); //
        System.out.println("Kelvin = "+k);     //
    }
}

Output :

Posting Komentar

3 Komentar

  1. Makasih gan, lumayan membantu

    BalasHapus
  2. The Casino: 50 Free Spins No Deposit | Oklahomacasinoguru
    Free spins 유흥업소 사이트 and 할리우드 배우 노출 no deposit bonuses are a great way to keep 벳365코리아 your winnings going as soon as you can in 스포츠 벳 the game! You can bet365 실시간 배당 흐름 play this exciting game in a variety

    BalasHapus
  3. Golden Gate Resort & Casino, NV | Mapyro
    Golden Gate Casino, Las Vegas, NV, United States. Map. 서귀포 출장샵 Golden Gate 양주 출장마사지 Resort & Casino (mapyro). View map. Golden 하남 출장안마 Gate Resort & Casino 원주 출장샵 (mapyro). 과천 출장안마

    BalasHapus