Program nilai mahasiswa
program nilai_mahasiswa;
uses wincrt;
label firman;
var
nama,grade:string;
stb,bulat,i:integer;
n_a,n_t,n_m,n_f:real;
ulang:char;
begin
writeln('nilai akhir mata kuliah Algoritma 1');
writeln('===================================');
writeln;
firman:
write('Nama Mahasiswa = ');readln(nama);
write('Stambuk = ');readln(stb);
write('Nilai Tugas = ');readln(n_t);
write('Nilai MID = ');readln(n_m);
write('Nilai Final = ');readln(n_f);
n_a:=20/100*n_t+30/100*n_m+50/100*n_f;
writeln('Nilai Akhir = ',n_a:3:2);
write('Dibulatkan = ');readln(bulat);
case bulat of
85..100: grade:='A';
70..84: grade:='B';
55..69: grade:='C';
40..59: grade:='D';
0..39: grade:='E';
end;
writeln('grade = ',grade);
writeln;
write('Input Lagi (y/n) =');readln(ulang);
writeln;
if ulang = 'y' then
goto firman
else
if ulang = 'n' then
writeln('##selesai##');
end.
layout:
No comments:
Post a Comment
Silahkan masukkan komentar sobat, komentar sobat sangat berarti buat saya