Senin, 27 April 2009

Program Cek kelulusan dalam bahasa Pascal

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.

0 komentar:

Template by : kendhin x-template.blogspot.com