# Penggunaan Case Of pada bangun ruang

program bangun_ruang;
uses wincrt;
const Pi=22/7;
var
x

:integer;

a,b,c

:real;

L1,L2,L3,V

:real;

begin
writeln('

------------------------------------');

writeln('

------- P I L I H A N ------');

writeln('

------------------------------------');

writeln('

1. Tabung');

writeln('

2. Balok');

writeln('

3. Prisma');

writeln('

4. Limas segi empat beraturan');

writeln('

------------------------------------');

writeln;
writeln;

case x of
1: Begin
writeln('--------------------------------------');
writeln('

T A B U N G');

writeln('--------------------------------------');
writeln;
write('Masukkan diameter tabung: ');
write('Masukkan tinggi tabung : ');
writeln;
writeln('Maka :');
L1:=Pi*a*b;
L2:=Pi*sqr(a/2);
writeln('Luas alas tabung adalah : ',L2:0:2);
V:=L2*b;

: ',V:0:2);

L3:=L1+(2*L2);

: ',L3:0:2);

writeln('--------------------------------------');

end;
2: Begin
writeln('--------------------------------------');
writeln('

B A L O K');

writeln('--------------------------------------');
writeln;
write('Masukkan panjang balok: ');
write('Masukkan tinggi balok : ');
write('Masukkan lebar balok : ');
writeln;
writeln('Maka :');
L1:=(2*a*b)+(2*b*c)+(2*a*c);
V:=a*b*c;
L3:=4*a+4*b+4*c;
writeln('--------------------------------------');

end;
3: Begin
writeln('--------------------------------------');
writeln('

P R I S M A ');

writeln('--------------------------------------');
writeln;
writeln('Masukkan ');

writeln('--------------------------------------');
end;
4: Begin
writeln('--------------------------------------');
writeln('

L I M A S ');

writeln('--------------------------------------');
writeln;
writeln('Masukkan ');
writeln('--------------------------------------');
end;
end;

if x>4 then
writeln('maaf,,menu pilihan yang anda masukkan salah')
else
writeln('maaf,,menu pilihan yang anda masukkan salah..');
end.