Berikut ini salah satu contoh program pascal total nilai akhir menggunakan IF
1.Programnya
Program TotalNilai;
uses crt;
var
NH,NT,NUTS,NUAS,NA : real;
begin
clrscr;
Writeln('Program Total Nilai Mahasiswa');
Write('Input Nilai Hadir =');readln(NH);
Write('Input Nilai Tugas =');readln(NT);
Write('Input Nilai UTS =');readln(NUTS);
Write('Input Nilai UAS =');readln(NUAS);
NA:=0.1*NH+0.2*NT+0.3*NUTS+0.4*NUAS;
Writeln('Total Nilai Akhir=',NA:2:0);
readln;
end.
1.Programnya
Program TotalNilai;
uses crt;
var
NH,NT,NUTS,NUAS,NA : real;
begin
clrscr;
Writeln('Program Total Nilai Mahasiswa');
Write('Input Nilai Hadir =');readln(NH);
Write('Input Nilai Tugas =');readln(NT);
Write('Input Nilai UTS =');readln(NUTS);
Write('Input Nilai UAS =');readln(NUAS);
NA:=0.1*NH+0.2*NT+0.3*NUTS+0.4*NUAS;
Writeln('Total Nilai Akhir=',NA:2:0);
readln;
end.
2.Program pascal
3.Hasilnya