Minggu, 03 April 2011

TUBE VOLUME SEARCHING PROGRAM WITH JAVA

import java.util.Scanner;
public class Tabung
{
    public static void main(String args[])
    {
// Variable declaration
        Scanner masuk = new Scanner(System.in);
        double jari, tinggi, volume; 
//Variable input finger-finger and height of the keyboard
        System.out.print("Masukkan Jari - jari Tabung : ");
        jari = masuk.nextFloat();
        System.out.print("Masukkan Tinggi Tabung : ");
        tinggi = masuk.nextFloat();
 //Formula to calculate volume
        volume = 3.14 * jari * jari *tinggi;
 //Call a variable volume
        System.out.println("Volume Tabung     = "+volume);
    }
}

Tidak ada komentar:

Posting Komentar