Tugas 2, Bagus Dermawan / 2012420050

Tugas 2, Bagus Dermawan / 2012420050

Mencari Volume Tabung, Luas Selimut tabung, dan Luas permukaan Tabung

/*
 * 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();
        x.LuasSelimut();
        x.LuasPermukaan();
      
    }
    }
}

Hasil Print Outnya














Atau Bisa download Filenya disini

Nama       : Bagus Dermawan
Nim         : 2012420050



share this article to: Facebook Twitter Google+ Linkedin Technorati Digg
Posted by arek informatika, Published at 02.24 and have 0 komentar

Tidak ada komentar:

Posting Komentar