Google Translator

Program Record Wisatawan dengan Pascal

Program Record_wisatawan;
uses crt;
type
form=record
nama_kmr   :string;
harga,lm_inap :integer;
ttl  :longint;
end;
data_wisata=record
nama         :string[15];
asal         :string[10];
jml_data :integer;
form1 :array[1..10]of form;
end;
var
wisata:array [1..10]of data_wisata;
jml_wst, i, j:integer;
begin
clrscr;
writeln('Program Record Wisatawan');

writeln('========================');
write('Jumlah Wisatawan yang datang : '); readln(jml_wst);
for i:=1 to jml_wst do
begin
writeln('----------------------------------');
writeln('Masukan Jumlah Data Wisatawan : ',i);
writeln('----------------------------------');
write('Nama : '); readln(wisata[i].nama);
write('Asal : '); readln(wisata[i].asal);
write('Masukan Data wisatawan : '); readln(wisata[i].jml_data);
for j:=1 to wisata[i].jml_data do
begin
writeln('-----------------------');
writeln('Isi Form Keterangan :',j);
writeln('-----------------------');
write('Nama Kamar : '); readln(wisata[i].form1[j].nama_kmr);
write('Harga/ Hari: '); readln(wisata[i].form1[j].harga);
write('Lama Inap  : '); readln(wisata[i].form1[j].lm_inap);
wisata[i].form1[j].ttl := wisata[i].form1[j].harga*wisata[i].form1[j].lm_inap;
writeln('Total      : ',wisata[i].form1[j].ttl);
writeln;
end;
end;
writeln;
writeln('Data Wisatawan Yang di Masukan :');
writeln('================================');
for i:=1 to jml_wst do
begin
writeln('Nama:',wisata[i].nama);
writeln('Asal:',wisata[i].asal);
writeln('Keterangan Wisatawan :');
writeln('============================================================================');
writeln('No.   |        Nama Kamar        |   Harga/ Hari   |  Lama Inap  |  Total  |');
writeln('============================================================================');
for j:= 1 to wisata[i].jml_data do
begin
writeln(j:4,wisata[i].form1[j].nama_kmr:20,wisata[i].form1[j].harga:15,wisata[i].form1[j]
.lm_inap:15,wisata[i].form1[j].ttl:20);
end;
end;
readln;
end.

Tidak ada komentar:

Posting Komentar

Masukan Pesan..
Tidak menerima spam..dan hal2 berbau porno jika melanggar comment akan di delete