Menghitung Suhu dengan Menggunakan Scanner Pada Pemrograman Java
05.16.00ﺑﺴﻢﷲﺍﻠﺮﺤﻤﻦﺍﻠﺮﺤﻴﻢ
import java.util.Scanner;
public class JavaApplication26{
public static double hitung_celcius(int k){
double celcius = k-273;
return celcius;
}
public static double hitung_reamur(int k){
double reamur = 4/5*(k-273);
return reamur;
}
public static double hitung_fahrenheid(int k){
double fahrenheid = 9/5*(k-273);
return fahrenheid;
}
public static void main(String[]args){
System.out.printf("masukkan suhu Kelvin: ");
Scanner konversi = new Scanner(System.in);
int suhu=konversi.nextInt();
double celcius;
double reamur;
double fahrenheid;
0 komentar