uses wincrt;
var
a,p,l,t:integer;
volume,luas,kel:longint;
b:0..1;
volume1,luas1,s,kel1:real;
pil:1..8;
const
phi=22/7;
label
lagi;
begin
lagi:
clrscr;
writeln(' MENU UTAMA');
writeln('=======================================');
writeln('# 1. Perhitungan Balok #');
writeln('# 2. Perhitungan Kubus #');
writeln('# 3. Perhitungan Limas Segi Empat #');
writeln('# 4. Perhitungan Kerucut #');
writeln('# 5. Perhitungan Bola #');
writeln('# 6. Perhitungan Tabung #');
writeln('# 7. Menentukan Bilangan Prima #');
writeln('# 8. Selesai #');
writeln('=======================================');
write('Masukkan Pilihan Anda ==>> ');readln(pil);
writeln('=======================================');writeln;
case pil of
1:
begin
writeln(' PERHITUNGAN BALOK');writeln;
write('Masukkan Panjang ==>> ');readln(p);
write('Masukkan Lebar ==>> ');readln(l);
write('Masukkan Tinggi ==>> ');readln(t);
volume:=p*l*t;
luas:=2*(p*l)+2*(p*t)+2*(l*t);
kel:=(4*p)+(4*l)+(4*t);
writeln('Volome ==>> ',volume);
writeln('Luas ==>> ',luas);
writeln('Keliling ==>> ',kel);
end;
2:
begin
writeln(' PERHITUNGAN KUBUS');writeln;
write('Masukkan Sisi ==>> ');readln(p);
Volume:=p*p*p;
Luas:=6*(p*p);
Kel:=12*p;
writeln('Volume ==>> ',volume);
writeln('Luas ==>> ',luas);
writeln('Keliling ==>> ',kel);
end;
3:
begin
writeln(' PERHITUNGAN LIMAS SEGI EMPAT');writeln;
write('Masukkan Panjang ==>> ');readln(p);
write('Masukkan Lebar ==>> ');readln(l);
write('Masukkan Tinggi ==>> ');readln(t);
volume1:=(p*l*t)*1/3;
writeln('Volume ==>> ',volume1:6:2);
end;
4:
begin
writeln(' PERHITUNGAN KERUCUT');writeln;
write('Masukkan Jari Jari ==>> ');readln(p);
write('Masukkan Tinggi ==>> ');readln(t);
volume1:=phi*p*p*t*1/3;
writeln('Volume ==>> ',volume1:6:2);
end;
5:
begin
Writeln(' PERHITUNGAN BOLA');writeln;
write('Masukkan Jari Jari ==>> ');readln(p);
write('Masukkan Tinggi ==>> ');readln(t);
volume1:=4/3*phi*p*t*t*t;
luas1:=4*phi*p*p;
writeln('Volume ==>> ',volume1:6:2);
writeln('Luas ==>> ',luas1:6:2);
end;
6:
begin
Writeln(' PERHITUNGAN TABUNG');writeln;
write('Masukkan Jari Jari ==>> ');readln(p);
write('Masukkan Tinggi ==>> ');readln(t);
volume1:=phi*p*p*t;
luas1:=phi*p*2*t*p;
kel1:=(p+p)*phi*t;
writeln('Volume ==>> ',volume1:6:2);
writeln('Luas ==>> ',luas1:6:2);
writeln('Keliling ==>> ',kel1:6:2);
end;
7:
begin
Writeln(' MENENTUKAN BILANGAN PRIMA');writeln;
write('Masukkan Sembarang Bilangan ==>> ');readln(p);
l:=round(sqrt(p))+1;
b:=1;
if (p=2 ) or (p=3) then b:=1
else
for t:= 2 to l do
if p mod t = 0 then
b:=0;
if b=1 then
writeln('Bilangan Prima')
else
writeln('Bukan Bilangan Prima');
end;
8:
begin
writeln('Program Selesai. . . .');
halt;
end;
end;
readln;
goto lagi;
end.
nah jadinya seperti ini
0 comments:
Post a Comment