Program Java Mencari Volume dan Luas Kubus
Program Java Mencari Luas Permukaan Kubus menggunakan BufferedReader br.
///
import java.io.*;
public class kubus{
kubus(){
}
public static void main(String[] input) throws IOException{
double s,v,L;
kubus sisi = new kubus();
BufferedReader br = new BufferedReader(new InputStreamReader (System.in));
System.out.print("Masukkan Sisi : ");
s=Integer.parseInt(br.readLine());
v=s*s*s;
L=6*(s*s);
System.out.println("Volume Kubus= "+v+"cm");
System.out.println("Luas Kubus= "+L+"cm");
}
}
///
import java.io.*;
public class kubus{
kubus(){
}
public static void main(String[] input) throws IOException{
double s,v,L;
kubus sisi = new kubus();
BufferedReader br = new BufferedReader(new InputStreamReader (System.in));
System.out.print("Masukkan Sisi : ");
s=Integer.parseInt(br.readLine());
v=s*s*s;
L=6*(s*s);
System.out.println("Volume Kubus= "+v+"cm");
System.out.println("Luas Kubus= "+L+"cm");
}
}
Comments
Post a Comment