unit Unit16;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, unit2;

type
  TForm16 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;

    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);

    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form16: TForm16;
 a:integer;
 b:string;
implementation

{$R *.dfm}



procedure TForm16.Button1Click(Sender: TObject);
begin
button2.Visible:=true;
button3.Visible:=false;
form16.Close;
end;

procedure TForm16.Button2Click(Sender: TObject);

begin

a:=0;
if edit1.Text='1' then a:=1;
if edit1.Text='2' then a:=2;
if edit1.Text='3' then a:=3;
if edit1.Text='4' then a:=4;
if a=0 then ShowMessage('Введите номер варианта от 1 до 4')
else
  begin
  if a=1 then label6.Caption:='BPSK';
    if a=2 then label6.Caption:='QPSK';
      if a=3 then label6.Caption:='QAM-16';
        if a=4 then label6.Caption:='QAM-32';
  if a=1 then label9.Caption:='10 GBPS';
    if a=2 then label9.Caption:='40 GBPS';
      if a=3 then label9.Caption:='100 GBPS';
        if a=4 then label9.Caption:='400 GBPS';
button2.Visible:=false;
button3.Visible:=true;
  end;
end;

procedure TForm16.Button3Click(Sender: TObject);
begin
if edit1.Text='1' then a:=1;
if edit1.Text='2' then a:=2;
if edit1.Text='3' then a:=3;
if edit1.Text='4' then a:=4;
if a=1 then b:='2';
if a=2 then b:='3';
if a=3 then b:='3';
if a=4 then b:='8';
if edit2.Text=b then
begin
unit2.p4:=true;
unit2.form2.done4.visible:=true;
ShowMessage('Задание решено верно');
button2.Visible:=true;
button3.Visible:=false;
Form16.Close;
end
else
showMessage('Задание решено не верно');

end;

end.
