/*
* To change this
template, choose Tools | Templates
* and open the
template in the editor.
*/
package Tabung;
import javax.swing.JOptionPane;
/**
*
* @author Toshiba
*/
public class tabung {
double r, t, volume, permukaan, selimut;
double pi = 3.14;
public void
LuasPermukaan (){
permukaan =
(2*pi*r*(r+t));
System.out.println("Hasil Luas Permukaan = " +permukaan+"
Cm3");
}
public void
LuasSelimut (){
selimut =
(2*pi*r*t);
System.out.println("Hasil Luas Selimut = " +selimut+"
Cm3");
}
public void
VolumeTabung (){
volume =
pi*r*r*t;
System.out.println("Hasil Volume Tabung = " +volume+"
Cm3");
}
public static void
main(String[] args) {
// TODO code
application logic here
tabung x = new
tabung();{
//INPUTAN
x.r =
Integer.parseInt(JOptionPane.showInputDialog("Massukkan Jari-jari"));
x.t =
Integer.parseInt(JOptionPane.showInputDialog("Massukkan Tinggi
Tabung"));
//OUTPUT
System.out.println("Jari - jari Tabung = "+x.r+"
Cm");
System.out.println("Tinggi Tabung = "+x.t+" Cm");
System.out.println("");
x.VolumeTabung();
}
}
Hasil Print Outnya
Nim : 2012420050
Posted by 02.24 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar