Program RataRataNilai;
Uses wincrt;
label atas;
Var
uts,uas,jum : array [1 ..5] of integer;
nim,nama,al : array [1..5] of string;
i : integer;
nilai:array [1..5] of real;
n: array [1..5] of string;
begin
(* bagian ini untuk input data nilai *)
atas:
clrscr;
For i :=1 to 5 do
begin
Write ('NIM ', i,':');
Readln (nim[ i]);
Write ('NAMA ', i,':');
Readln (nama[ i ]);
Write ('NILAI UAS ',i ,':');
Readln (uas[ i]);
Write ('NILAI UTS ', i,':');
Readln (uts[ i ]);
Write ('ALAMAT ', i,':');
Readln (al[ i ]);
Writeln;
End;
(*bagian menghitung nilai *)
For i :=1 to 5 do
Begin
jum[i]:= uas[i] + uts[i];
nilai[i]:=jum[i]/2;
End;
For i := 1 to 5 do
Begin
If nilai[i]>84 then n[i]:='A' else if nilai[i]>79 then n[i]:= 'B+' else
If nilai[i] > 74 then n[i]:='B'else
if nilai[i] > 69 then n[i]:='C+' else if nilai[i] > 59 then n[i]:='C' else
IF nilai[i] > 49 then n[i]:='D' else n[i]:='E';
End;
Writeln('-------------------------------------------------------------------');
WRiteln('NIM Nama Nilai Alamat');
WriteLn('-------------------------------------------------------------------');
For i:=1 to 5 do
writeln('',nim[i],' ',nama[i],' ',n[i],' ',al[i]);
Writeln('-------------------------------------------------------------------');
Readln; goto atas;
end.
knpa mbak pinter banget sich... mkannya apa dong....?
BalasHapus