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 = TV SONY');
end;
procedure output;
begin
harga:=650000;
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:output;
end;
readln;
until (kode=003);
if kode=003 then pembelian:='tidak ada';
writeln('pembelian =',pembelian);
readln;
end.
Tidak ada komentar:
Posting Komentar