USES CRT;
VAR
NAMA : STRING [20];
NPM : STRING [15];
NILAI_MID : INTEGER;
NILAI_TUGAS : INTEGER;
NILAI_ABSEN : INTEGER;
NILAI_SEMESTER : INTEGER;
TOTAL_NILAI : REAL;
RATA_RATA : REAL;
NILAI_HURUF : STRING;
KETERANGAN : STRING;
BEGIN
CLRSCR;
WRITELN (' DAFTAR NILAI');
WRITELN (' ________________');
WRITELN;
WRITE ('NAMA : '); READLN (NAMA);
WRITE ('NPM : '); READLN (NPM);
WRITE ('NILAI_MID : '); READLN (NILAI_MID);
WRITE ('NILAI_TUGAS : '); READLN (NILAI_TUGAS);
WRITE ('NILAI_ABSEN : '); READLN (NILAI_ABSEN);
WRITE ('NILAI_SEMESTER : '); READLN (NILAI_SEMESTER);
WRITELN;
TOTAL_NILAI := NILAI_MID + NILAI_TUGAS + NILAI_ABSEN + NILAI_SEMESTER;
WRITELN ('TOTAL_NILAI : ', TOTAL_NILAI :0:0);
WRITELN;
RATA_RATA := TOTAL_NILAI / 4;
WRITELN ('RATA_RATA : ', RATA_RATA :0:0);
WRITELN;
IF (RATA_RATA >= 80) THEN
BEGIN
NILAI_HURUF := 'A';
KETERANGAN := 'SANGAT BAIK';
END
ELSE
IF (RATA_RATA >= 70) THEN
BEGIN
NILAI_HURUF := 'B';
KETERANGAN := 'BAIK';
END
ELSE
IF (RATA_RATA >= 60) THEN
BEGIN
NILAI_HURUF := 'C';
KETERANGAN := 'CUKUP';
END
ELSE
IF (RATA_RATA >= 50) THEN
BEGIN
NILAI_HURUF := 'D';
KETERANGAN := 'KURANG';
END
ELSE
IF (RATA_RATA < 50) THEN
BEGIN
NILAI_HURUF := 'E';
KETERANGAN := 'GAGAL';
END;
WRITELN ('NILAI_HURUF : ', NILAI_HURUF);
WRITELN;
WRITELN ('KETERANGAN : ', KETERANGAN);
READLN;
END.
0 komentar:
Posting Komentar