Rabu, 05 Oktober 2011

Program untuk Mencari Volume Bola dan Luas Lingkaran

import jeliot.io.*;
class hitung
{
public hitung(){ cari = 0;}
public void masukan()
      {
              System.out.print("Masukan jari-jari lingkaran:");
              rl = Input.nextDouble();
              luas =(3.14 *rl *rl);
              System.out.print("Masukan jari-jari bola:");
              rb = Input.nextDouble();
              volume =(1.33 *3.14 *rb *rb *rb);
              System.out.print("luas lingkaran:");
              System.out.print(luas);
              System.out.print("\n");
              System.out.print("volume bola:");
              System.out.print(volume);
}
                private double rb;
                private double cari;
                private double rl;
                private double luas;
                private double volume;
 public static void main() {
      hitung a = new hitung();
      a.masukan();

    }}

Outputnya ni:

0 komentar:

Blogger template 'Purple Mania' by Ourblogtemplates.com 2008

Jump to TOP