Pert.10 (pascal Procedure dan array)

Buat Tampilan sebagai berikut setelah dijalankan, disini akan menggunakan pemanggilan procedure garis dan menggunakan array.

Tampilan Input Data :
pas01.jpg

Tampilan Output Data :
pas02.jpg

Listing Program :

uses crt;

procedure garis;
begin
writeln(‘————————————————-‘);
end;

var i,j : integer;
kode:array[1..5] of integer;
nama,jabatan:array[1..5] of string;
gapok,tunj:array[1..5] of real;

begin
clrscr;
writeln(‘ PENGGAJIAN PT. OGAH MAJU’);
garis;
writeln;
write(‘Masukan jumlah data karyawan : ‘);readln(j);

for i:=1 to j do
begin
writeln(‘Data ke-‘, i);
write(‘Masukan Nama Karyawan : ‘);readln(nama[i]);
write(‘Masukan Kode Jabatan [1/2/3] : ‘);readln(kode[i]);
garis;
case kode[i] of
1:
begin
jabatan[i]:=’Direktur’;
gapok[i]:=1000000;
end;
2:
begin
jabatan[i]:=’Manajer’;
gapok[i]:=800000;
end;
3:
begin
jabatan[i]:=’Staff’;
gapok[i]:=700000;
end;
end;
if jabatan[i] = ‘Direktur’ then
tunj[i]:=20/100*gapok[i]
else
tunj[i]:=10/100*gapok[i];
end;
clrscr;
writeln(‘Informasi Gaji Karyawan’);
for i:=1 to j do
begin
garis;
writeln(‘Nama Karyawan : ‘,nama[i]);
writeln(‘Jabatan : ‘,jabatan[i]);
writeln(‘Gaji Pokok : ‘,gapok[i]:8:0);
writeln(‘Tunjangan : ‘,tunj[i]:8:0);
garis;
end;
readln;
end.

Silakan Anda Modifikasi….

Iklan

4 Comments

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s