19.04
gembel mania
program pendataanbuku ITHINGT;
uses wincrt;
const maks = 90;
type recbuku = record
kode : string[20];
judul : string[20];
eks : integer;
harga : real;
end;
var
buku : recbuku;
dafbuku : array [1..maks] of recbuku;
j,cacah : integer;
pilih : char;
begin
repeat
writeln('===================================================');
writeln ('menu pilihan');
writeln ('[1]. memasukan data buku');
writeln ('[2]. lihat daftar buku');
writeln ('[3].selesai');
writeln('===================================================');
writeln;
write ('Pilihan Proses :');readln (pilih);
case pilih of
'1' : begin
write ('berapa buku ?');readln (cacah);
for j:=1 to cacah do
begin
writeln ('Data ke -',j);
write('kode buku :');readln(buku.kode);
write('judul buku :');readln(buku.judul);
write('eksemplar :');readln(buku.eks);
write('harga buku:');readln(buku.harga);
end;
end;
'2' : begin
writeln('====================================================');
writeln('=====================Data Buku======================');
writeln('No kode Buku eks Judul Buku Harga');
for j:=1 to cacah do
begin
with dafbuku[j] do
writeln(j,#32, buku.kode:15,#32,buku.eks:15,#32,buku.judul:15,#32,buku.harga:15:2);
writeln('====================================================');
end;
end; end;
Until pilih= '3' ;
end.
0 komentar:
Posting Komentar