Wednesday, March 7, 2012
Struktur aray pascal.
1:52 AM
Struktur ARRAY PASCAL....,
Cara memasukan ke prgram pascal.
1. bukak notpad
2. kopas scrip ini kedalamnya.
lalu beri nama contoharay.pas
3. dan ganti save as type text documen (*.txt) dengan all files
lasu save, keluar dan,
4.bukak file dengan klik kiri, open with file dengan turbo pascal
Silahkan di copi:
program gaji;
uses crt;
var
nm,nik: ARRAY [1..10] OF string;
gol,gj,gjt,p,gjb,gjk:ARRAY [1..10] OF real;
A,N:integer;
begin
clrscr;
writeln('#####################################################');
writeln('# PROGRAM GAJI KARYAWAN #');
writeln('#####################################################');
writeln;
begin
clrscr;
writeln('program gaji');
write('masukn banyak data :'); readln (N);
writeln;
for A := 1 TO N DO
begin
writeln('data ke -',A:3);
write('Masukan nama anda = '); readln (nm[A]);
write('Masukan no induk kaaryawan = '); readln (nik[A]);
write('masukan golongan anda = '); readln (gol[A]);
end;
writeln;
clrscr;
writeln('daftar gaji');
writeln('===========================================================================');
writeln('| no | nama | gaji | gj tnjangan | pajak | gaji kotor | gaji bersih |');
writeln('===========================================================================');
for A := 1 TO N DO
begin
if gol[A] = 1 then gj[A] := 500000
else if gol[A] = 2 then gj[A] := 700000
else if gol[A] = 3 then gj[A] := 900000
else if gol[A] = 4 then gj[A] := 1100000;
if gol[A] = 1 then gjt[A] := 15*500000/100
else if gol[A] = 2 then gjt[A] := 20/100*700000
else if gol[A] = 3 then gjt[A] := 25/100*900000
else if gol[A] = 4 then gjt[A] := 30/100*1100000;
if gol[A] = 1 then p[A] := 10/100*500000
else if gol[A] = 2 then p[A] := 10/100*700000
else if gol[A] = 3 then p[A] := 10/100*900000
else if gol[A] = 4 then p[A] := 10/100*1100000;
gjk[A] := gj[A]+gjt[A];
gjb[A] := gjk[A]-p[A];
gotoxy(1,A+4); write ('|');
gotoxy(3,A+4); write (A);
gotoxy(6,A+4); write ('|');
gotoxy(7,A+4); write (nm[A]);
gotoxy(17,A+4); write ('|');
gotoxy(18,A+4); write (gj[A]:2:2);
gotoxy(26,A+4); write ('|');
gotoxy(27,A+4); write (gjt[A]:2:2);
gotoxy(40,A+4); write ('|');
gotoxy(41,A+4); write (p[A]:2:2);
gotoxy(48,A+4); write ('|');
gotoxy(49,A+4); write (gjk[A]:2:2);
gotoxy(61,A+4); write ('|');
gotoxy(62,A+4); write (gjb[A]:2:2);
gotoxy(75,A+4); write ('|');
end;
writeln;
writeln('===========================================================================');
readln;
end;
end.
Salam BLOGGER..............,
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment