uses crt;
var
kode : byte;
harga : longint;
jumlah: integer;
total : real;
pembelian : string;
procedure input;
begin
harga := 1000000;
total := harga*jumlah;
writeln('total =Rp',total:2:0);
writeln('pembelian = vcd player');
end;
begin
clrscr;
repeat
writeln ('menu kode pilihan');
writeln ('__________________');
writeln ('001.tv sony');
writeln ('002.vcd player');
writeln ('003.tidak ada');
writeln;
write ('jumlah='); readln (jumlah);
write ('kode =' ); readln (kode);
case kode of
001: input;
002: input;
end;
readln;
until (kode=003);
if kode=003 then pembelian:='tidak ada';
writeln('pembelian =',pembelian);
readln;
end.
Bukti Pemograman Prosedure |