Uses crt;
type larik = array[1..8] of
integer;
type larek = array[1..8] of
string;
var x,y,p : larik;
z,m : larek;
i, n : integer;
a,b,c,e : real;
begin
clrscr;
writeln
('============================================');
writeln ('= Nama : Ni Putu Dana Prityaningsih =');
writeln ('= Jurusan : Ilmu Komputer =');
writeln ('= NIM : 1206085002 =');
writeln ('= Kelas : B =');
writeln
('============================================');
write ('masukkan jumlah
matkul : '); readln (n);
writeln;
i := 0;
for i := 1 to n do
begin
write ('masukkan mata kuliah ke- ',i,' ','anda
: '); readln (m[i]);
write ('masukkan sks anda : '); readln (x[i]);
write ('masukkan nilai (A/B/C/D/E) : '); readln
(z[i]);
if z[i] = 'A' then {y[i] := 4} p[i] := x[i]*4;
if z[i] = 'B' then {y[i] := 3 }p[i] := x[i]*3;
if z[i] = 'C' then {y[i] := 2 } p[i] :=
x[i]*2;
if z[i] = 'D' then {y[i] := 1} p[i] := x[i]*1;
if z[i] = 'E' then {y[i] := 0} p[i] := x[i]*0;
b:= b+x[i];
e:= e+p[i];
end;
writeln;
clrscr;
writeln
('------------------------------------------------------------');
writeln ('| No ':1 , '| ':2,
' Nama Matakuliah ':5, ' | ' :2, ' SKS ':5, '| ', ' Nilai ':7, '| ':4, ' Nilai
X SKS ':5,' | ':2);
writeln ('------------------------------------------------------------');
for i := 1 to n do
begin
writeln ('| ',i,' |
':4,m[i]:11,'|':8,x[i]:4,'|':3,z[i]:4,'|':7,p[i]:8,'|':8);
end;
c := e/b;
writeln
('____________________________________________________________');
writeln ('| TOTAL ',
'|':18 ,b:4:0, '|':3, '|':11, e:8:0
,'|':8);
Writeln
('------------------------------------------------------------');
readln;
end.
Tidak ada komentar:
Posting Komentar