program ortalamalar;
uses crt;
label
yukari, son;
type
dersler = (matematik, fen, kimya);
type
ogr_kayit = record
no : integer;
ad : string[20];
soyad : string[20];
sinav : array[1..3,1..3] of 0..100;
ort : array[1..3] of real;
end;
var
ogrenci : array[1..10] of ogr_kayit;
ders : dersler;
i , j, k : integer;
ch : char;
begin
clrscr;
yukari:
i := 1;
with ogrenci[i] do
begin
write(i,'.ci ”§rencinin numarasn giriniz...>');
readln(no);
while ogrenci[i].no > 0 do
begin
{$R+}
write(i,'.ci Ӥrencinin ismini giriniz...>');
readln(ad);
write(i,'.ci Ӥrencinin soyismini giriniz...>');
readln(soyad);
no := no;
ad := ad;
soyad := soyad;
i := i + 1;
for ders := matematik to kimya do
begin
k := k + 1;
for j := 1 to 3 do
begin
case ord(ders) of
0 : write('matematik ', j, '.ci svav notu giriniz...>');
1 : write('fen ', j, '.ci svav notu giriniz...>');
2 : write('kimya ', j, '.ci svav notu giriniz...>');
end;
readln(sinav[k,j]);
sinav[k,j] := sinav[k,j];
ort[k] := ort[k] + sinav[k,j];
end;
end;
end;
{$R-}
writeln('Bilgisayara kayt edilmiŸtir.');
writeln('Yeni kayt i‡in E ‡kmak i‡in H,ye basnz...');
readln(ch);
if ch in ['E','e'] then
begin
k := 0;
goto yukari;
end;
clrscr;
writeln('™gr_numaras':10, '˜sim':10, 'Soyisim':10, 'Matematik':10,'Fen':10,'Kimya':10);
write(no:12,ad:10,soyad:10);
write(sinav[1,1]:10,sinav[2,1]:10,sinav[3,1]:10);
writeln;
writeln(sinav[1,2]:42,sinav[2,2]:10,sinav[3,2]:10);
writeln(sinav[1,3]:42,sinav[2,3]:10,sinav[3,3]:10);
writeln(' TOPLAMLAR VE ORTALAMALAR : --------------------------');
writeln(ort[1]:42:2,ort[2]:10:2,ort[3]:10:2);
writeln(ort[1]/3:42:2,ort[2]/3:10:2,ort[3]/3:10:2);
goto son;
end;
son:
readln;
end.