Jumat, 23 Oktober 2009
~ Pascal Array+Looping ~
program Array_looping;
uses crt;
label yana;
var tgs,mid,final,rata:array[1..5] of real;
data,y:integer;
lagi:char;
begin
yana:
clrscr;
writeln;
write('Masukkan Jumlah Data : ');readln(data);
writeln;
writeln('--- Data Nilai ---');
for y:=1 to data do
begin
write('Masukkan Nilai Tugas: ');readln(tgs[y]);
write('Masukkan Nilai MID : ');readln(mid[y]);
write('Masukkan Nilai Final: ');readln(final[y]);
writeln;
end;
clrscr;
writeln(' @@ Hasil Nilai @@');
writeln;
writeln('-----------------------------');
writeln(' No Nilai Rata');
writeln(' Tugas MID Final Rata');
writeln('-----------------------------');
writeln;
for y:=1 to data do
begin
gotoxy(1,wherey);write(y);
gotoxy(6,wherey);write(tgs[y]:2:0);
gotoxy(11,wherey);write(mid[y]:2:0);
gotoxy(16,wherey);write(final[y]:2:0);
rata[y]:=(tgs[y]+mid[y]+final[y])/3;
gotoxy(21,wherey);writeln(rata[y]:2:2);
end;
writeln;
write('Create: Y@na');
writeln;
writeln;
write('Input data lagi..?? ');readln(lagi);
if(lagi='Y') or (lagi='y') then
goto yana;
readln;
end.
By; YaNa
Langganan:
Posting Komentar (Atom)
1 komentar:
nice . ^^
Posting Komentar