CONTOH PROGRAM PASCAL | Array
CONTOH PROGRAM PASCAL | Array
uses wincrt;
var Nama:array[1..3] of string;
x,i,h,a,b,c,d:integer;
nilai:array[1..3] of real;
begin for I:= 1 to 3 do
begin
clrscr;
writeln('SELAMAT DATANG DI PROGRAM KALKULASI KELULUSAN');
WRITELN('+++++++++++++++++++++++++++++++++++++++++++++');
writeln('KETERANGAN :');
WRITELN('INPUT NILAI 1-10');
writeln('BATAS KETUNTASAN ADALAH 5.0');
WRITELN('===========================');
write('masukan nama :');readln(Nama[i]);
write('masukan nilai keseharian :');readln(a);
write('masukan nilai UTS :');readln(b);
write('masukan nilai UAS :');readln(c);
nilai[i]:=(a+b+c)*0.5;
end;
clrscr;
for I:=1 to 3 do
if (nilai[i]) >=5then
begin
writeln('Nama : ',Nama[I],' mendapat nilai : ',nilai[i]:5:2);
writeln('SELAMAT ' ,NAMA[I], ' ANDA LULUS');
writeln('------------------------------');
end
else
begin
writeln('Nama : ',Nama[I],' mendapat nilai : ',nilai[i]:5:2);
Writeln('MAAF ' , NAMA[I] , ' ANDA GAGAL');
writeln('------------------------------');
end;
readln;
End.
uses wincrt;
var Nama:array[1..3] of string;
x,i,h,a,b,c,d:integer;
nilai:array[1..3] of real;
begin for I:= 1 to 3 do
begin
clrscr;
writeln('SELAMAT DATANG DI PROGRAM KALKULASI KELULUSAN');
WRITELN('+++++++++++++++++++++++++++++++++++++++++++++');
writeln('KETERANGAN :');
WRITELN('INPUT NILAI 1-10');
writeln('BATAS KETUNTASAN ADALAH 5.0');
WRITELN('===========================');
write('masukan nama :');readln(Nama[i]);
write('masukan nilai keseharian :');readln(a);
write('masukan nilai UTS :');readln(b);
write('masukan nilai UAS :');readln(c);
nilai[i]:=(a+b+c)*0.5;
end;
clrscr;
for I:=1 to 3 do
if (nilai[i]) >=5then
begin
writeln('Nama : ',Nama[I],' mendapat nilai : ',nilai[i]:5:2);
writeln('SELAMAT ' ,NAMA[I], ' ANDA LULUS');
writeln('------------------------------');
end
else
begin
writeln('Nama : ',Nama[I],' mendapat nilai : ',nilai[i]:5:2);
Writeln('MAAF ' , NAMA[I] , ' ANDA GAGAL');
writeln('------------------------------');
end;
readln;
End.
0 komentar:
Post a Comment