program menu pilihan

program case_of;

uses wincrt;

var pilihan:integer;

b,c,d,e,f,g,h:real;

begin

writeln(‘MENU PILIHAN’);

writeln(‘1.menghitung volum kubus’);

writeln(‘2.menghitung volum balok’);

writeln(‘3.menghitung volum limas segi-4’);

writeln(‘masukkan pilihan=’);readln(pilihan);

clrscr;

case pilihan of

1:begin

write(‘masukkan rusuk=’);readln(b);

c:=b*b*b;

writeln(‘volum kubus=’,c:5:2);

end;

2:begin

write(‘masukkan panjang,lebar,tinggi=’);readln(d,e,f);

g:=d*e*f;

writeln(‘volum balok=’,g:5:2);

end;

3:begin

write(‘masukkan panjang,lebar,tinggi=’);readln(d,e,f);

h:=(d*e*f)/3;

writeln(‘volum limas segi-4=’,h:5:2);

end;

end;

end.

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

w

Connecting to %s

%d blogger menyukai ini: