Selasa, 17 November 2009

TUGAS ARRAY

program belanja;
uses wincrt;
var
i,b:byte;
nm,nmbh,nmsyr:array [1..50]of string;
begin
writeln('========================================');
writeln('TUGAS ALGORITMA PEMROGRAMAN KOMPUTER I');
writeln(' OLEH: I');
writeln('1.RINA NURMARIANA [4112309008] I');
writeln('2.DIVA ARISTA [4112309011] I');
writeln('3.DANIAR SARI NASTITI [4112309013] I');
writeln('4.ROHMAH MUGI RAHAYU [4112309021] I');
writeln('========================================');
WRITELN;
writeln('Warung Bu Joko');

writeln('__________________________________');

write('MASUKKAN DATA=');readln(b);

for i:=1 to b do

begin

writeln('data ke-',i);

writeln;

write('nama pengunjung=');readln(nm[i]);

write('nama buah [1. apel/2. durian]:');readln(nmbh[i]);

write('jenis sayur[1. sawi/2. bayam]:');readln(nmsyr[i]);

end;

writeln;

writeln('warung bu Joko');


writeln('============================================================');

writeln('NO NAMA PENGUNJUNG NAMA BUAH Jenis sayur');

writeln;

for i:=1 to b do

begin

if nmbh[i]='1' then

nmbh[i]:='apel'

else

nmbh[i]:='durian';

if nmsyr[i]='2' then

nmsyr[i]:= 'sawi'

else

nmsyr[i]:='bayam';
end;

for i:=1 to b do

begin


writeln(i:1,nm[i]:9,nmbh[i]:10,nmsyr[i]:18);

end;


writeln('===========================================================');
readln;
end.

Tidak ada komentar:

Posting Komentar