Skip to content

Program Cek kelulusan dalam bahasa Pascal

April 27, 2009

program cek_kelulusan_siswa;
uses crt;
var
nama : string[25];
kelas : string[5];
no_absen : string[3];
n_tugas : byte;
n_u_hari : byte;
n_u_umum : byte;
rerata : real;
lulus : boolean;
predikat : string[20];
begin
clrscr;
writeln(‘====================================================’);
writeln(‘| Program Mengecek Kelulusan Siswa |’);
writeln(‘====================================================’);
writeln;
writeln(‘Input Data Siswa’);
writeln(‘—————-‘);
write(‘Nama : ‘); readln(nama);
write(‘Kelas : ‘); readln(kelas);
write(‘No Absen : ‘); readln(no_absen);
write(‘Nilai Tugas : ‘); readln(n_tugas);
write(‘Nilai Ulangan Harian : ‘); readln(n_u_hari);
write(‘Nilai Ulangan Umum : ‘); readln(n_u_umum);
rerata:=(n_tugas + 2 * n_u_hari + 3 * n_u_umum)/6;
if rerata >=70 then lulus:=true
else lulus:= false;
clrscr;
writeln(‘====================================================’);
writeln(‘| Program Mengecek Kelulusan Siswa |’);
writeln(‘====================================================’);
writeln;
writeln(‘ Siswa dengan’);
writeln(‘—————-‘);
writeln(‘Nama : ‘,nama);
writeln(‘Kelas : ‘,kelas);
writeln(‘No Absen : ‘,no_absen);
writeln(‘Nilai Tugas : ‘,n_tugas);
writeln(‘Nilai Ulangan Harian : ‘,n_u_hari);
writeln(‘Nilai Ulangan Umum : ‘,n_u_umum);
writeln(‘Rata – rata : ‘,rerata:0:2);
if lulus then
begin
if rerata < 80 then predikat:='memuaskan'
else if rerata <90 then predikat:='sangat memuaskan'
else predikat:=’dengan pujian’;
writeln(‘Dinyatakan Lulus dengan ‘,predikat);
end
else
writeln(‘Dinyatakan Tidak Lulus’);
readln;
end.

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

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

%d bloggers like this: