Membuat program laporan transaksi Warnet dengan Turbo Pascal

program warnet;
uses crt;

type
transaksi=record
no_kmptr:string;
durasi:integer;
jns_lay:string;
nama_lay:string;
tarif:integer;
end;

var
trans:array [1..10] of transaksi;
i,j,x,a,b,c,d:integer;
jml:integer;
total:real;

begin
clrscr;
j:=0;
a:=0;
b:=0;
c:=0;
d:=0;
writeln(‘=============================================’);
writeln(‘                         WARNET “BINA CYBER”                            ‘);
writeln(‘=============================================’);
write(‘Masukan Jumlah Transaksi : ‘);readln(jml);
writeln;

if jml>10 then
begin
writeln(‘Melebihi Kapasitas’);
end
else
begin
for i:=1 to jml do
begin
with trans[i] do
begin
write(‘Transaksi ke- ‘,i,’ dari ‘,jml);writeln;
write(‘No Komputer      : ‘);readln(no_kmptr);
write(‘Jenis Layanan    : ‘);readln(jns_lay);
writeln;
if (jns_lay =’A’) or (jns_lay=’a’) then
begin
nama_lay:=’Internet’;
tarif:= 2500;
end
else
if (jns_lay=’B’) or (jns_lay=’b’) then
begin
nama_lay:=’Game Online’;
tarif:= 3000;
end
else
if (jns_lay=’C’) or (jns_lay=’c’) then
begin
nama_lay:=’Game Ofline’;
tarif:= 2000;
end
else
if (jns_lay=’D’) or (jns_lay=’d’) then
begin
nama_lay:=’Rental Pengetikan’;
tarif:= 1500;
end
else
begin
nama_lay:=”;
end;
write(‘Tarif Per Menit ‘,tarif);
writeln;
write(‘Durasi Bermain  : ‘);readln(durasi);
writeln;
end;
end;
writeln(‘===============================================’);
writeln(‘No.’:8,’Jenis’:15,’Durasi’:12,’Tarif’:17,’Total’:13);
writeln(‘Komp’:8,’Layanan’:15,’Bermain’:12,’Per Menit’:17,’  ‘:13);
writeln(‘===============================================’);
total:=0;
for i:=1 to jml do
begin
with trans[i] do
begin
if (jns_lay=’A’) or (jns_lay=’a’) then a:=a+1;
if (jns_lay=’B’) or (jns_lay=’b’) then b:=b+1;
if (jns_lay=’C’) or (jns_lay=’c’) then c:=c+1;
if (jns_lay=’D’) or (jns_lay=’d’) then d:=d+1;
writeln(no_kmptr:8,jns_lay:15,durasi:12,tarif:17,tarif*durasi:13);
total:=total+(tarif*durasi);
end;
end;
end;
writeln(‘==============================================’);
writeln;
write(‘                        Total Keseluruhan           : Rp. ‘,total:2:2);
writeln;
if (a>=b) and (a>=c) and (a>=d) then
write(‘                        Jenis Layanan Paling Banyak : Internet’)
else
if (b>=a) and (b>=c) and (b>=d) then
write(‘                        Jenis Layanan Paling Banyak : Game Online’)
else
if (c>=a) and (c>=b) and (c>=d) then
write(‘                        Jenis Layanan Paling Banyak : Game Offline’)
else
if (d>=a) and (d>=b) and (d>=c) then
write(‘                        Jenis Layanan Paling Banyak : Rental Pengetikan’);

readln;
end.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s