Program Input_nilai_mhs;
Uses WinCrt;
Const
garis ='------------------------------------------------------------------';
Var
nil1,nil2 : Array [1..100] of 0..100;
nim : Array [1..10] of string [8];
nama : Array [1..10] of string [50];
n,i,bar : Integer;
jum : Real;
tl : Char;
Begin
ClrScr;
writeln ('Maximize dulu windows anda,');
writeln ('Untuk mendapat hasil yang maksimal!!!');
write ('Berapa data mahasiswa yang akan diinput :');
readln(n);
for i:= 1 to n do
begin
clrscr;
gotoxy (30,4+1); write ('data ke-:',i : 2);
gotoxy (10,5+i); write ('NIM :'); readln(nim[i]);
gotoxy (10,6+i); write ('Nama :'); readln(nama[i]);
gotoxy (10,7+i); write ('Nilai 1 :'); readln(nil1[i]);
gotoxy (10,8+i); write ('Nilai 2 :'); readln(nil2[i]);
end;
clrscr;
gotoXY (5,4); write (garis);
gotoxy (5,5); write ('NO');
gotoxy (9,5); write ('NIM');
gotoxy (18,5); write ('Nama');
gotoxy (38,5); write ('Nilai 1');
gotoxy (45,5); write ('Nilai 2');
gotoxy (52,5); write ('Rata');
gotoxy (59,5); write ('Abjad');
gotoxy (5,6);write(garis);
bar := 7;
for i := 1 to n do
begin
jum := (nil1[i] + nil2[i]) /2;
if jum >= 90 then tl := 'A'
else
if jum > 80 then tl := 'B'
else
if jum > 60 then tl := 'C'
else
if jum > 50 then tl := 'D'
else
tl := 'E' ;
gotoxy (5,bar); writeln (i:2);
gotoxy (9,bar); writeln (NIM[i]);
gotoxy (18,bar); writeln (Nama[i]);
gotoxy (38,bar); writeln (nil1[i]:4);
gotoxy (45,bar); writeln (nil2[i]:4);
gotoxy (52,bar); writeln (jum:5:1);
gotoxy (59,bar); writeln (tl);
bar := bar + 1;
end;
gotoxy (5,bar+1); writeln (garis);
readln;
end.
Apabila source code / scripnya sudah selesai di ketik dan di COMPILE lalu di RUN kan apabila tidak ada errornya maka akan tampil satu per satu gambar di bawah ini .
boleh requst ga nih...???
ReplyDeleteklo boleh langsung ja ya,,
bngung nih soal ini... mklum msi awam... :D
Buat program dgn inputan : NIM, Nama, Nilai Pascal
Jika, nilai pascal >=85 maka mutu huruf A
Jika, nilai pascal >=70<=85 maka mutu huruf B
Jika, nilai pascal>=55<=70 maka mutu huruf C
Jika, nilai pascal>=40<=55 maka mutu huruf D
Jika, nilai pascal>=30<=39 maka mutu huruf E
Tambahkan variabel keterangan, jika mutu huruf A,B,C,D maka Lulus, jika E maka belum lulus.