DODI SETIAWAN | 201243502240 | TI | UNINDRA
Listing
Code :
Program nilai_mahasiswa;
uses wincrt;
var
nim, nama, nilai_huruf, ket : string;
nilai_akhir, tugas, uts, uas : integer;
begin
writeln('PROGRAM PERHITUNGAN NILAI MAHASISWA');
writeln('=======================================');
writeln;
write('Nim : '); readln(nim);
write('Nama : '); readln(nama);
writeln('=======================================');
writeln;
writeln(' Masukan Nilai Mahasiswa ');
writeln('=======================');
write('Nilai Tugas :'); readln(tugas);
write('Nilai UTS :'); readln(mites);
write('Nilai UAS :'); readln(uas);
nilai_akhir := (tugas*20 + uts*30 + uas*50) div 100;
if (nilai_akhir >= 80) and (nilai_akhir <=100)then
nilai_huruf:= 'A'
else
if (nilai_akhir >= 68) and (nilai_akhir <= 79) then
nilai_huruf:= 'B'
else
if (nilai_akhir >= 56) and (nilai_akhir <= 67) then
nilai_huruf:= 'C'
else
if (nilai_akhir >= 0) and (nilai_akhir <= 59) then
nilai_huruf:= 'D';
case nilai_akhir of
60..100 : ket:=('LULUS');
else
ket:=('TIDAK LULUS');
end;
writeln;
writeln(' Maka
Hasilnya Adalah :
');
writeln('============================================================');
writeln('Hasil nilai akhir ' ,nama, ' adalah
' ,nilai_akhir
);
writeln('Nilai huruf yang didapat adalah
' ,nilai_huruf, ' maka ' ,nama, ' dinyatakan
',ket );
readln;
end.
Unknown
Minggu, 25 September 2016