contoh program array pada pascal :
program contoh_konstan_array_char_;
uses wincrt;
var
nilai_akhir : INTEGER;
nilai_kehadiran,nilai_UTS,nilai_Tugas,nilai_UAS : ARRAY[1..4] OF integer;
A,B,C,D = real;
begin
nilai_kehadiran [1] := 50;
nilai_UTS [2] := 60;
nilai_Tugas [3] := 50;
nilai_UAS [4] := 60;
begin
A = 0,1 * nilai_kehadiran[1]
writeln('10% DARI NILAI KEHADIRAN =');
readln(A);
B = 0,2 * nilai_UTS[2]
writeln('20% DARI NILAI UTS =');
readln(B)
C = 0,2 * nilai_Tugas[3]
writeln('20% DARI NILAI TUGAS =');
readln(C)
D = 0,5 * nilai_UAS[4]
writeln('50% DARI NILAI UAS =');
readln(D)
end;
begin
writeln('NILAI AKHIR = ',nilai_akhir= A+B+C+D)
readln(nilai_akhir)
end;
end.
No comments:
Post a Comment