Last active
August 29, 2015 14:11
-
-
Save mahirrudin/e1b18167fae2d537695f to your computer and use it in GitHub Desktop.
Java CLI - Conversion Temperature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
public class KonversiTemperatur { | |
public static void main(String[] args) { | |
double tempC, tempR, tempF; | |
String bilangan = JOptionPane.showInputDialog("Masukkan Celcius : "); | |
System.out.println("Masukkan angka : " + bilangan); | |
tempC = Double.parseDouble(bilangan); | |
tempR = tempC*4/5; | |
tempF = tempC*9/5+32.0; | |
System.out.println("Temperature Celcius = " + tempC ); | |
System.out.println("Temperature Reamur = " + tempR ); | |
System.out.println("Temperature Fahrenheit = " + tempF ); | |
System.exit(0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment