Описать массив записей , содержащий информацию об итогах сдачи вами сессии в институте. Определить средний балл — Pascal(Паскаль)

uses crt;
const n=1;
type student=record
      name:string;
      hyst,math,infm,engl:integer;
      sr:real;
     end;
var x:array[1..n] of student;
    i:integer;
begin
ClrScr;
for i:=1 to n do
 with x[i] do
  begin
   Write(' Name: ');
   Readln(name);
   Write(' Hyst: ');
   Readln(hyst);
   Write(' Math: ');
   Readln(math);
   Write(' Infm: ');
   Readln(infm);
   Write(' Engl: ');
   Readln(engl);
  end;
Writeln('Table: ');
for i:=1 to n do
 x[i].sr:=x[i].hyst+x[i].math+x[i].infm+x[i].engl;
Writeln('--------------------------------------------------');
Writeln('|  Name  | Hyst | Math | Infm | Engl || Sr.Ball ||');
Writeln('--------------------------------------------------');
for i:=1 to n do
 Writeln('|',x[i].name:8,'|',x[i].hyst:6,'|',x[i].math:6,'|',x[i].infm:6,
         '|',x[i].engl:6,'||',x[i].sr/4:9:1,'||');
Writeln('--------------------------------------------------');
Readln;
end.

Leave a Comment

19 − 12 =