Pascal Program Nilai Mahasiswa
Source code berikut untuk menghitung nilai mahasiswa pada pascal
Copy source code berikut :
Copy source code berikut :
program nilai;
uses wincrt;
var
nil1,nil2,nil3:integer;
procedure nilai_mhs;
var
hs1,tgs,uts,uas:real;
begin
tgs:=0.3*nil1;
uts:=0.3*nil2;
uas:=0.4*nil3;
hs1:=tgs+uts+uas;
writeln;
writeln('Nilai Tugas = 30% * ',nil1,' = ',tgs:2:2);
writeln('Nilai UTS = 30% * ',nil2,' = ',uts:2:2);
writeln('Nilai UAS = 40% * ',nil3,' = ',uas:2:2);
writeln;
writeln('Hasil Nilai = ',hs1:2:2);
writeln;
if (hs1>=90) then
write('Prosentase = A')
else
if (hs1>=70) then
write('Prosentase = B')
else
if (hs1>=50) then
write('Prosentase = C')
else
if (hs1>=30) then
write('Prosentase = D')
else
begin
write('Prosentase = E');
end;
end;
begin
gotoxy(21,1);writeln('------------------------------');
gotoxy(21,2);writeln('>> Program Nilai Mahasiswa <<');
gotoxy(21,3);writeln('- nassroom.blogspot.com -');
gotoxy(21,4);writeln('-----------------------------');
writeln;
write('Masukkan Nilai Tugas = ');readln(nil1);
write('Masukkan Nilai UTS = ');readln(nil2);
write('Masukkan Nilai UAS = ');readln(nil3);
writeln;
nilai_mhs;
end.
uses wincrt;
var
nil1,nil2,nil3:integer;
procedure nilai_mhs;
var
hs1,tgs,uts,uas:real;
begin
tgs:=0.3*nil1;
uts:=0.3*nil2;
uas:=0.4*nil3;
hs1:=tgs+uts+uas;
writeln;
writeln('Nilai Tugas = 30% * ',nil1,' = ',tgs:2:2);
writeln('Nilai UTS = 30% * ',nil2,' = ',uts:2:2);
writeln('Nilai UAS = 40% * ',nil3,' = ',uas:2:2);
writeln;
writeln('Hasil Nilai = ',hs1:2:2);
writeln;
if (hs1>=90) then
write('Prosentase = A')
else
if (hs1>=70) then
write('Prosentase = B')
else
if (hs1>=50) then
write('Prosentase = C')
else
if (hs1>=30) then
write('Prosentase = D')
else
begin
write('Prosentase = E');
end;
end;
begin
gotoxy(21,1);writeln('------------------------------');
gotoxy(21,2);writeln('>> Program Nilai Mahasiswa <<');
gotoxy(21,3);writeln('- nassroom.blogspot.com -');
gotoxy(21,4);writeln('-----------------------------');
writeln;
write('Masukkan Nilai Tugas = ');readln(nil1);
write('Masukkan Nilai UTS = ');readln(nil2);
write('Masukkan Nilai UAS = ');readln(nil3);
writeln;
nilai_mhs;
end.