program harga_tiket_pesawat;
uses crt;
var
np,ket,nb:array[1..15]of string;
jb:array[1..15] of real;
harkot,harsih:array[1..15]of real;
jml,a:byte;
tot,b:real;
harga:integer;
potongan:real;
lagi:char;
label awal,akhir;
begin
awal:
writeln('========================================');
writeln(' INPUT DATA PEMBELIAN TIKET PESAWAT');
writeln('========================================');
writeln;
write('masukkan jumlah penumpang:');readln(jml);
writeln;
for a:=1 to jml do
begin
writeln(' Data Ke=',a);
write('Nama Penumpang:');readln(np[a]);
write('Jumlah Beli:');readln(jb[a]);
write('Keterangan Tiket:');readln(ket[a]);
write('Nomor Booking:');readln(nb[a]);
end;
clrscr;
gotoxy(20,2);writeln('LAPORAN PENJUALAN TIKET PESAWAT');
writeln('-----------------------------------------------------------------');
writeln('No Booking Nama_Penumpang Harga_Kotor Ket.Tiket Harga_Bersih');
writeln('------------------------------------------------------------------');
tot:=0;
for a:=1 to jml do
begin
b:=0.1;
harkot[a]:=jb[a]*700000;
if(ket[a]='promo') or (ket[a]='PROMO')then
begin
potongan:=(harkot[a]*b);
harsih[a]:=(harkot[a]-potongan);
end
else
begin
harsih[a]:=harkot[a];
end;
tot:=tot+harsih[a];
end;
for a:=1 to jml do
writeln(nb[a]:1,a:1,np[a]:22,harkot[a]:15:2,ket[a]:13,harsih[a]:16:2);
begin
writeln('-----------------------------------------------------------');
writeln('Total Rp.',tot:10:2);
writeln('-----------------------------------------------------------');
writeln('Ket : Jika Promo dapat diskon 10% dari harga kotor, tidak promo tidak ada diskon');
write('Apakah anda ingin memasukkan data selanjutanya(Y/N)?:');readln(lagi);
if(lagi='Y')or(lagi='Y')then
goto awal;
end
end.
DevvoutNDegassu™
Tidak ada komentar:
Posting Komentar