program menghitungnilaimahasiswa;
uses wincrt;
var
nM1,nM2, nM3, nim1, nim2, nim3, hasil1, hasil2, hasil3:string;
nilai1, nilai2, nilai3:integer;
begin
write('Nama : '); readln(nM1);
write('Nim : '); readln(nim1);
write('nilai : '); readln(nilai1);
write('Nama : '); readln(nM2);
write('Nim : '); readln(nim2);
write('nilai : '); readln(nilai2);
write('Nama : '); readln(nM3);
write('Nim : '); readln(nim3);
write('nilai : '); readln(nilai3);
case nilai1 of
0..40 : hasil1 := 'E';
41..50 : hasil1 := 'D';
51..60 : hasil1 := 'C';
61..70 : hasil1 := 'C+';
71..80 : hasil1 := 'B';
81..90 : hasil1 := 'B+';
91..100 : hasil1 := 'A';
end;
case nilai2 of
0..40 : hasil2 := 'E';
41..50 : hasil2 := 'D';
51..60 : hasil2 := 'C';
61..70 : hasil2 := 'C+';
71..80 : hasil2 := 'B';
81..90 : hasil2 := 'B+';
91..100 : hasil2 := 'A';
end;
case nilai3 of
0..40 : hasil3 := 'E';
41..50 : hasil3 := 'D';
51..60 : hasil3 := 'C';
61..70 : hasil3 := 'C+';
71..80 : hasil3 := 'B';
81..90 : hasil3 := 'B+';
91..100 : hasil3 := 'A';
end;
writeln('Nilai ',nM1, ' adalah ',hasil1);
writeln('Nilai ',nM2, ' adalah ',hasil2);
writeln('Nilai ',nM3, ' adalah ',hasil3);
end.
Tidak ada komentar:
Posting Komentar