Program suhu dari Celcius ke Fahrenheit Menggunakan Java

Share On :



1. Klik Start >> run (Logo windows + R)
2. Ketik cmd >> Ok, maka akan tampil kotak CPrompt

public class suhu {
public static void main(String[] args)
{
//deklarasi variabel
int c1, c2, c3, f1, f2, f3;
//proses perhitungan konversi
c1 = 34;
f1 = ((c1*9/5)+32) ;

c2 = 0;
f2 = ((c2*9/5)+32) ;

c3 = 24;
f3 = ((c3*9/5)+32) ;
//proses output
System.out.println("\t\t***KONVERSI SUHU DARI CELCIUS ke FAHRENHEIT***\n");
System.out.println("\t\t\t=*=*=*=*=*=*=*=*=*=*=*=*=*=*");
System.out.println("\t\t\tSuhu Awal dalam Celcius : "+c1+"\n");
System.out.println("\t\t\t34 Celcius is "+f1);
System.out.println("\t\t\t=*=*=*=*=*=*=*=*=*=*=*=*=*=*");
System.out.println("\t\t\tSuhu Awal dalam Celcius : "+c2+"\n");
System.out.println("\t\t\t0 Celcius is "+f2);
System.out.println("\t\t\t=*=*=*=*=*=*=*=*=*=*=*=*=*=*");
System.out.println("\t\t\tSuhu Awal dalam Celcius : "+c3+"\n");
System.out.println("\t\t\t24 Celcius is "+f3 );
System.out.println("\t\t\t=*=*=*=*=*=*=*=*=*=*=*=*=*=*");
}
}

Output :



0 komentar:

Post a Comment

  • Mahasiswa STMIK Duta Bangsa
  • description
  • description
  • description
  • description
  • description
  • description
  • description

Free Hosting

Free Hosting

My Blog List

A
B
C
     
D
E
F
DuGMp3    
G
H
I
Goo Otomotif HouseofScript  
J
K
L
Java Hotline    
M
N
O

My Games Collection

MeLangKah LeBih MaJu

   
P
Q
R
Pamella Decoration    
S
T
U
Studied WaLL    
V
W
X
     
Y
Z
0-9
     









Join....!


Free Domain

Free Domain

SiNyO. Powered by Blogger.