Jumat, 22 April 2011

Perulangan(array)

uses wincrt;
var
 gol:char;gapok:longint;
     tunjangan,gatot:real;jb:char;
     label 1;
begin
          1:
clrscr;
writeln('menentukan gaji pegawai');
writeln('-----------------------');
write ('masukan golongan [A/B/C]:');readln(gol);
if( gol='A')or(gol='a') then
   begin
   gapok:=600000;
   tunjangan:=0;
   end
else if( gol='B')or(gol='b')  then
   begin
   gapok:=700000;
   tunjangan:=0.05*gapok;
   end
else
  begin
  gapok:=8000000;
  tunjangan:=0.1*gapok;
  end;

gatot:=gapok+tunjangan;
writeln('----------------------');
writeln('gaji pokok:Rp.',gapok);
writeln('tunjangan:Rp.',tunjangan:0:2);
writeln('gaji total:Rp.',gatot:0:2);
writeln('------------------------------');
write('ada lagi?(Y/T):');readln(jb);
if (jb='Y')or(jb='y') then
   goto 1;
writeln('----------------------------------');
writeln('by:Fince Tinus Waruwu');

readln;
end.