Pascal Penjadwalan Job / Proses


LISTING PROGRAM :

Download Klik Disini

Program Penjadwalan_Job;
{adalah program untuk penjadwalan job}

uses crt;

var
job_a, job_b, job_c, job_d, job_e :string[1];
a1, a2, b1, b2, c1, c2, d1, d2, e1, e2 : real;
start_a, start_b, start_c, start_d, start_e : real;
end_a, end_b, end_c,end_d, end_e : real;
late_a, late_b, late_c, late_d, late_e : real;
late_a1, late_b1, late_c1, late_d1, late_e1 : real;
tot_idle, tot_late : real;
lagi : char;

begin
lagi:=’y’;
while (lagi=’y’) or (lagi=’Y’) do

begin
clrscr;
writeln(‘Program Penjadwalan Job’);
writeln;
writeln(‘Dibuat oleh :’);
writeln(‘***********************’);
writeln(‘Nama      : SUJITO’);
writeln(‘NIM       : 350.663.018’);
writeln(‘Jurusan   : SI’);
writeln(‘***********************’);
writeln;
writeln(‘JUMLAH JOB   : 5’);
writeln;
writeln(‘Input Job Ke-1’);
writeln(‘——————-‘);
write(‘Nama Job       : ‘); readln(job_a);
write(‘Time           : ‘); readln(a1);
write(‘Due Date       : ‘); readln(a2);

writeln;
writeln(‘Input Job Ke-2’);
writeln(‘——————-‘);
write(‘Nama Job       : ‘); readln(job_b);
write(‘Time           : ‘); readln(b1);
write(‘Due Date       : ‘); readln(b2);

writeln;
writeln(‘Input Job Ke-3’);
writeln(‘——————-‘);
write(‘Nama Job       : ‘); readln(job_c);
write(‘Time           : ‘); readln(c1);
write(‘Due Date       : ‘); readln(c2);

writeln;
writeln(‘Input Job Ke-4’);
writeln(‘——————-‘);
write(‘Nama Job       : ‘); readln(job_d);
write(‘Time           : ‘); readln(d1);
write(‘Due Date       : ‘); readln(d2);

writeln;
writeln(‘Input Job Ke-5’);
writeln(‘——————-‘);
write(‘Nama Job       : ‘); readln(job_e);
write(‘Time           : ‘); readln(e1);
write(‘Due Date       : ‘); readln(e2);

begin
start_a := 0;
end_a:= start_a+a1;
late_a := a2-end_a;

start_b := end_a;
end_b:= start_b+b1;
late_b := b2-end_b;

start_c := end_b;
end_c:= start_c+c1;
late_c := c2-end_c;

start_d := end_c;
end_d:= start_d+d1;
late_d := d2-end_d;

start_e := end_d;
end_e:= start_e+e1;
late_e := e2-end_e;

//menghitung total idle
tot_idle := (start_a+start_b+start_c+start_d+start_e);

//mengidentifikasi nilai late tiap job, hanya nila minus yang diambil
if late_a<0 then {jika minus maka ambil nilai late}
begin
late_a1:=late_a;
end
else             {jika plus maka nol-kan nilai late}
begin
late_a1:=0;
end;

if late_b<0 then
begin
late_b1:=late_b;
end
else
begin
late_b1:=0;
end;

if late_c<0 then
begin
late_c1:=late_c;
end
else
begin
late_c1:=0;
end;

if late_d<0 then
begin
late_d1:=late_d;
end
else
begin
late_d1:=0;
end;

if late_e<0 then
begin
late_e1:=late_e;
end
else
begin
late_e1:=0;
end;

//menghitung total late
tot_late := (late_a1+late_b1+late_c1+late_d1+late_e1);

//menampilkan hasil penjadwalan
clrscr;
writeln;
writeln(‘PROSES PENJADWALAN’);
writeln;
writeln(‘URUT START DUR   END    DD  LATE’);
writeln(‘——————————–‘);
writeln(job_a, start_a:6:0, a1:6:0, end_a:6:0, a2:6:0, late_a:6:0);
writeln;
writeln(job_b, start_b:6:0, b1:6:0, end_b:6:0, b2:6:0, late_b:6:0);
writeln;
writeln(job_c, start_c:6:0, c1:6:0, end_c:6:0, c2:6:0, late_c:6:0);
writeln;
writeln(job_d, start_d:6:0, d1:6:0, end_d:6:0, d2:6:0, late_d:6:0);
writeln;
writeln(job_e, start_e:6:0, e1:6:0, end_e:6:0, e2:6:0, late_e:6:0);
writeln(‘——————————–‘);

writeln;
writeln(‘HASIL AKHIR’);
writeln(‘========================’);
writeln(‘Total Idle Time : ‘,tot_idle:6:2);
writeln(‘Total Late      : ‘,tot_late:6:2);
writeln(‘========================’);

end;

writeln;
write(‘Mau coba lagi ? [y/t] ‘);
readln(lagi);
end;
end.

2 thoughts on “Pascal Penjadwalan Job / Proses

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s