header-photo

Contoh Program Nilai Mahasiswa

Program NMHS;
Uses wincrt;
Var
nim,nm,kel,nh:string;
uts,uas,nt,na:real;
Begin
writeln('PROGRAM INPUT NILAI');
writeln('========================');
Write('Masukan Nama Mahasiswa : ');Readln(nm);
Write('Masukan NIM : ');Readln(nim);
Write('Masukan Nilai UTS : ');Readln(uts);
Write('Masukan Nilai UAS : ');Readln(uas);
Write('Masukan Nilai Tugas : ');Readln(nt);
clrscr;


writeln('PROGRAM NILAI MAHASISWA');
writeln('========================');
Writeln('Nama Mahasiswa : ',nm);
Writeln('NIM : ',nim);
na:=((0.2*nt)+(0.3*uts)+(0.5*uas));
Writeln('Nilai Angka : ',na:2:0);

IF ((na > 84) AND (na <= 100)) THEN
nh := 'A'
ELSE IF ((na > 74) AND (na <= 85)) THEN
nh := 'B'
ELSE IF ((na > 59) AND (na <= 75)) THEN
nh := 'C'
ELSE IF ((na > 39) AND (na <= 60)) THEN
nh := 'D'
ELSE
nh := 'E';
Writeln('Nilai Huruf : ',nh);

begin
IF nh = 'A' THEN
kel := 'Lulus'
ELSE IF nh = 'B' THEN
kel := 'Lulus'
ELSE IF nh = 'C' THEN
kel := 'Lulus'
ELSE IF nh = 'D' THEN
kel := 'Tidak Lulus'
ELSE
kel := 'Tidak Lulus'
end;
Writeln('Kelulusan : ',kel);
end.

0 komentar:

Poskan Komentar