
лабораторная работа / лабораторные работы по ASSAMBLER / 5 по СПО
.docxЗадание.Сводная ведомость результатов экзаменационной сессии студенческой группы содержит фамилию, инициалы и оценки по трем предметам. Количество студентов в группе 15 человек. Составить программу, с помощью которой можно получать: список студентов, сдавших экзамены только на «5»;список студентов, имеющих тройки; список на отчисление студентов, имеющих более чем одну двойку.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, Spin, Buttons;
type
TForm1 = class(TForm)
Button1: TButton;
StringGrid1: TStringGrid;
Button2: TButton;
Button3: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private { Private declarations }
public { Public declarations }
end;
var
Form1: TForm1;
Implementation {$R *.dfm}
type
zap=record
fio:string[20];
fil,vv,pravo,number: integer;
end;
Var
MZap:array[1..15] of zap;
n: integer; // текущее кол-во элементов массива записей
procedure TForm1.FormCreate(Sender: TObject);
var i:integer;
begin with StringGrid1 do
begin
Cells[0,0]:='№';
Cells[1,0]:='ФИО';
Cells[2,0]:='Философия';
Cells[3,0]:='введение в специальность';
Cells[4,0]:='правоведение';
Cells[1,1]:='Алипова А.А.';Cells[2,1]:='4'; Cells[3,1]:='4'; Cells[4,1]:='3';
Cells[1,2]:='Боровиков Б.К.';Cells[2,2]:='3'; Cells[3,2]:='2'; Cells[4,2]:='4';
Cells[1,3]:='Васильева С.Т.';Cells[2,3]:='5'; Cells[3,3]:='5'; Cells[4,3]:='5';
Cells[1,4]:='Горсков К.Б.';Cells[2,4]:='2'; Cells[3,4]:='2'; Cells[4,4]:='3';
Cells[1,5]:='Дохненко А.П.';Cells[2,5]:='2'; Cells[3,5]:='2'; Cells[4,5]:='4';
Cells[1,6]:='Елисеева П.Н.';Cells[2,6]:='4'; Cells[3,6]:='3'; Cells[4,6]:='4';
Cells[1,7]:='Жукова Т.К.';Cells[2,7]:='3'; Cells[3,7]:='2'; Cells[4,7]:='4';
Cells[1,8]:='Зотова Б.М.';Cells[2,8]:='3'; Cells[3,8]:='3'; Cells[4,8]:='3';
Cells[1,9]:='Иванова А.С.';Cells[2,9]:='2'; Cells[3,9]:='2'; Cells[4,9]:='3';
Cells[1,10]:='Клочкова Н.Т.';Cells[2,10]:='3'; Cells[3,10]:='3'; Cells[4,10]:='4';
Cells[1,11]:='Ларина Т.А.';Cells[2,11]:='5'; Cells[3,11]:='5'; Cells[4,11]:='5';
Cells[1,12]:='Маринов А.Г.';Cells[2,12]:='4'; Cells[3,12]:='4'; Cells[4,12]:='4';
Cells[1,13]:='Носов И.Г.';Cells[2,13]:='4'; Cells[3,13]:='4'; Cells[4,13]:='4';
Cells[1,14]:='Очков С.Г';Cells[2,14]:='2'; Cells[3,14]:='2'; Cells[4,14]:='3';
Cells[1,15]:='Путин В.В.';Cells[2,15]:='3'; Cells[3,15]:='2'; Cells[4,15]:='2';
for i:=1 to 15 do with MZap[i] do
begin
fio:=Cells[1,i];
fil:=StrToInt(Cells[2,i]);
vv:=StrToInt(Cells[3,i]);
pravo:=StrToInt(Cells[4,i]);
end ;end;end;
procedure TForm1.Button1Click(Sender: TObject);
var i,j:integer;
buffer:zap;
begin
for i:=1 to 16 do
for j:=i+1 to 16 do
if (MZap[i].fil<>5) and (MZap[i].vv<>5) and (MZap[i].pravo<>5) then
begin with StringGrid1,MZap[i] do
begin
Cells[1,i]:='---';
Cells[2,i]:='---';
Cells[3,i]:='---';
Cells[4,i]:='---';
end; end; end;
procedure TForm1.Button2Click(Sender: TObject);
var i,j:integer;
buffer:zap;
begin
for i:=1 to 16 do
for j:=i+1 to 16 do
if (MZap[i].fil<>3) and (MZap[i].vv<>3) and (MZap[i].pravo<>3) then
begin with StringGrid1,MZap[i] do
begin
Cells[1,i]:='---';
Cells[2,i]:='---';
Cells[3,i]:='---';
Cells[4,i]:='---';
end; end; end;
procedure TForm1.Button3Click(Sender: TObject);
var i,j:integer; buffer:zap;
begin
for i:=1 to 16 do
for j:=i+1 to 16 do
if (MZap[i].fil<>2) and (MZap[i].vv<>2) and (MZap[i].pravo<>2) then
begin with StringGrid1,MZap[i] do begin
Cells[1,i]:='---';
Cells[2,i]:='---';
Cells[3,i]:='---';
Cells[4,i]:='---';
end; end; end; end.