program javascript menghitung tabung
1.
Program
menghitung
a.
Volume
tabung
Sesuai dengan rumusnya yaitu phi*r²*t jadi
r²=d
phi=3.14
atau 22/7
package volume.balok;
import java.util.Scanner;
public class VolumeBalok {
public static void main(String[] args) {
Scanner scan=new Scanner (System.in);
float phi, volume;
int r, t;
System.out.println("===============================");
System.out.println("Program menghitung volume tabung");
System.out.println("===============================");
System.out.print("Masukan jari-jari tabung\t :");
r=scan.nextInt();
System.out.print("Masukan tinggi tabung\t\t :");
t=scan.nextInt();
volume=(float)r*r*t*22/7;
System.out.println("=================================");
System.out.println("volume tabung adalah
:"+r+"*"+r+"*"+t+"*"+22+"/"+7+"="+volume);
System.out.println("=================================");
}
}
0 Response to "program menghitung tabung, "
Post a Comment