2012420149
package tugas;
import javax.swing.JOptionPane;
/**
*
* @author USER
*/
public class trap {
public double t = 0, a = 0, b = 0, sami = 0, K, L;
public void K(){
K = t + a + b + sami;
}
public void L(){
L = (a + b)*t/2;
}
public void jumlah(){
System.out.println("K=" + K);
System.out.println("L=" + L);
}
public static void main(String[] args) {
trap x = new trap();
x.t=Integer.parseInt(JOptionPane.showInputDialog(null , "MAsukan Tinggi"));
x.a=Integer.parseInt(JOptionPane.showInputDialog(null , "MAsukan Nilai A"));
x.b=Integer.parseInt(JOptionPane.showInputDialog(null , "MAsukan Nilai B"));
x.sami=Integer.parseInt(JOptionPane.showInputDialog(null , "MAsukan Samping Miring"));
x.K();
x.L();
x.jumlah();
}
}
Posted by 00.35 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar