Nama : M Fajar Firdaus
NIM : A1C614204
Program Sewa_VCD;
uses wincrt;
Type
VCD = RECORD
NP, KDVCD, JNS, STATUS : String[25];
LM, JML : Byte;
TRF, DENDA, DIS, TB : Real;
end;
DATAVCD = array [1..50] of VCD;
var
DATA : DATAVCD;
I, N : INTEGER;
GT : REAL;
procedure ISI;
begin
clrscr;
write ('Masukkan Jumlah Datanya : ');readln(N);
for I:=1 to N do
with DATA[I] do
begin
writeln;
writeln('Data Ke : ',I);
write('Nama Peminjam : ');readln(NP);
write('Kode VCD [V01-V02] : ');readln(KDVCD);
write('Status Peminjam [ANGGOTA / BUKAN ] : ');readln(STATUS);
write('Lama Pinjam : ');readln(LM);
write('Jumlah VCD Yang Dipinjam : ');readln(JML);
end;
end;
procedure TAMPIL;
begin
clrscr;
writeln(' PENYEWAAN VCD FAJAR UTAMA');
writeln(' JL. PANGLIMA BATUR');
Writeln(' BANJARBARU');
writeln('----------------------------------------------------------------------------');
writeln('NO NAMA KODE JENIS TARIF STATUS LAMA JUMLAH BESAR DISKON TOTAL');
writeln(' PEMINJAM VCD VCD SEWA PEMINJAM PINJAM PINJAM DENDA BAYAR ');
writeln('----------------------------------------------------------------------------');
for I:=1 to N do
with DATA[I] do
begin
if KDVCD='V01' then
JNS:='KOMEDI'
else
if KDVCD='V02' then
JNS:='DRAMA'
else
if KDVCD='V03' then
JNS:='ACTION';
if (JNS='KOMEDI') AND (STATUS='ANGGOTA') then
TRF:=5000
else
if (JNS='DRAMA') AND (STATUS='ANGGOTA') then
TRF:=6000
else
if (JNS='ACTION') AND (STATUS='ANGGOTA') then
TRF:=7000
else
if (JNS='KOMEDI') AND (STATUS='BUKAN') then
TRF:=6000
else
if (JNS='DRAMA') AND (STATUS='BUKAN') then
TRF:=7000
else
if (JNS='ACTION') AND (STATUS='BUKAN') then
TRF:=8000;
if LM>3 then
DENDA:=0.1*(TRF*JML)
else
DENDA:=0;
if (STATUS='ANGGOTA') AND (JNS='DRAMA') then
DIS:=0.15*(TRF*JML)
else
DIS:=0;
TB:=(TRF*JML)+DENDA-DIS;
writeln(I:2,NP:8,KDVCD:6,JNS:8,TRF:6:0,STATUS:10,LM:6,JML:8,DENDA:8:0,DIS:8:0,TB:8:0);
GT:=GT+TB;
end;
writeln('------------------------------------------------------------------------------');
writeln('GRANDTOTAL : ',' ',GT:9:0);
writeln('------------------------------------------------------------------------------');
end;
begin
ISI;
TAMPIL;
readln;
end.
Wednesday, November 23, 2016
Home »
Pengantar Teknologi Informasi
» Pengantar Teknologi Informasi - Program Pascal "Sewa VCD"
0 comments:
Post a Comment