Selasa, 12 April 2011

WEEKLY ASSIGNMENT

Assalamu'alaikum friends....how are you???
i hope you fine like me....

Ok this time I will be posting jeliot program calculates 
area of ​​a circle and volume of the ball .. If still there is
something wrong, please help my friends to fix it ... ok let's see

import jeliot.io.*;
public class luas {
public static void main ()
{
int r;
float luas;
System.out.print("Masukkan jari-jari:");
r = Input.readInt();
luas = (float) 3.14*r*r;
System.out.print("luas llingkaran=");
System.out.print(luas);
float volume;
volume = (float)4/3*(float)3.14*r*r*r;
System.out.print("volume bola=");
System.out.print(volume);
}
}


little explanation of my..

int r; is a variable declaration.
I use a float data type because it uses decimal. With Input.readInt();
we can enter the numbers that we want..from  luas = (float) 3.14*r*r;
System.out.print("luas llingkaran=");
System.out.print(luas);
float volume;
volume = (float)4/3*(float)3.14*r*r*r;
System.out.print("volume bola=");
System.out.print(volume); 
there was a wide circle and volume calculations ball..

That's a little explanation of my :))

Tidak ada komentar:

Posting Komentar