Разработка приложения "Базовые логические операции"

Дипломная работа - Компьютеры, программирование

Другие дипломы по предмету Компьютеры, программирование



>

Edit3.Text:=;

end;

end;

end;;TForm1.ComboBox1Change(Sender: TObject);:string;

Edit1.Text:=;

Edit2.Text:=;

Edit3.Text:=;

MaskEdit1.Text:=;

s:=ComboBox1.Items[ComboBox1.ItemIndex];

if s = Преподаватель then

begin

Panel1.Visible:=true;

Panel2.Visible:=false;

end;

if s = Студент then

begin

Panel2.Visible:=true;

Panel1.Visible:=false;

end; ;.

Листинг программы (Unit2).Unit2;

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls, ComObj, WordXP, OleServer;

TForm2 = class(TForm)

GroupBox1: TGroupBox;

Label7: TLabel;

Label8: TLabel;

ChB11: TCheckBox;

CoB11: TComboBox;

Button2: TButton;

CoB12: TComboBox;

ChB12: TCheckBox;

Label9: TLabel;

ChB13: TCheckBox;

CoB13: TComboBox;

Label10: TLabel;

ChB14: TCheckBox;

GroupBox2: TGroupBox;

Label1: TLabel;

Label2: TLabel;

ChB21: TCheckBox;

CoB21: TComboBox;

Button1: TButton;

CoB22: TComboBox;

ChB22: TCheckBox;

Label3: TLabel;

ChB23: TCheckBox;

CoB23: TComboBox;

Label4: TLabel;

ChB24: TCheckBox;

Label6: TLabel;

GroupBox3: TGroupBox;

Label13: TLabel;

Label14: TLabel;

ChB31: TCheckBox;

CoB31: TComboBox;

Button3: TButton;

CoB32: TComboBox;

ChB32: TCheckBox;

Label15: TLabel;

ChB33: TCheckBox;

CoB33: TComboBox;

Label16: TLabel;

ChB34: TCheckBox;

GroupBox4: TGroupBox;

Label5: TLabel;

Label11: TLabel;

Label12: TLabel;

Label17: TLabel;

ChB41: TCheckBox;

CoB41: TComboBox;

Button4: TButton;

CoB42: TComboBox;

ChB42: TCheckBox;

ChB43: TCheckBox;

CoB43: TComboBox;

ChB44: TCheckBox;

GroupBox5: TGroupBox;

Label18: TLabel;

Label19: TLabel;

Label20: TLabel;

Label21: TLabel;

ChB51: TCheckBox;

CoB51: TComboBox;

Button5: TButton;

CoB52: TComboBox;

ChB52: TCheckBox;

ChB53: TCheckBox;

CoB53: TComboBox;

ChB54: TCheckBox;

Panel1: TPanel;

Panel2: TPanel;

Panel3: TPanel;

Panel4: TPanel;

Label22: TLabel;

Label23: TLabel;

Label26: TLabel;

Label24: TLabel;

Label25: TLabel;

Label27: TLabel;

Label28: TLabel;

Label29: TLabel;

Label30: TLabel;

Label31: TLabel;

Label32: TLabel;

Label33: TLabel;

Label34: TLabel;

Label35: TLabel;

Label36: TLabel;

Label37: TLabel;

Label38: TLabel;

Label39: TLabel;

Label40: TLabel;

Label41: TLabel;

Label42: TLabel;

Label43: TLabel;

Label44: TLabel;

Label45: TLabel;

Button6: TButton;

WordApplication1: TWordApplication;

Button7: TButton;

Memo1: TMemo;

Memo2: TMemo;

procedure Button2Click(Sender: TObject);

procedure Button1Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

procedure Button4Click(Sender: TObject);

procedure Button5Click(Sender: TObject);

procedure Button6Click(Sender: TObject);

procedure Button7Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

Form2: TForm2;

{$R *.dfm}TForm2.Button2Click(Sender: TObject);,s2,s3,y1,y2,y3: string;l1,x2l1,x3l1,x4l1:string;l2,x2l2,x3l2,x4l2:string;l3,x2l3,x3l3,x4l3:string;l4,x2l4,x3l4,x4l4:string;

Label23.Caption:=;

Label24.Caption:=;

Label25.Caption:=;

Label26.Caption:=;

if (CoB11.Text=) or (CoB12.Text=) or (CoB13.Text=) then

ShowMessage(Заполните все операции 1 функции!!!)

else

begin

begin

if Chb11.Checked = true then

begin

x1l1:=not x1 ;

x1l2:=x1 ;

x1l3:=not x1 ;

x1l4:=not x1 ;

end

else

x1l4:=x1 ;

x1l1:=x1 ;

x1l3:=x1 ;

x1l2:=not x1 ;

end;

Begin

s1:=Cob11.Items[Cob11.ItemIndex];

if s1 = Конъюнкция (*) then

y1:=and ;

if s1 = Дизъюнкция (+) then

y1:=or ;

if s1 = Исключающее (ИЛИ) then

y1:=xor ;

end;

begin

if Chb12.Checked = true then

begin

x2l4:=not x2 ;

x2l1:=not x2 ;

x2l2:=x2 ;

x2l3:=x2 ;

end

else

x2l4:=x2 ;

x2l2:=not x2 ;

x2l1:=x2 ;

x2l3:=not x2 ;

end;

Begin

s2:=Cob12.Items[Cob12.ItemIndex];

if s2 = Конъюнкция (*) then

y2:=and ;

if s2 = Дизъюнкция (+) then

y2:=or ;

if s2 = Исключающее (ИЛИ) then

y2:=xor ;

end;

begin

if Chb13.Checked = true then

begin

x3l4:=not x3 ;

x3l2:=not x3 ;

x3l1:=x3 ;

x3l3:=not x3 ;

end

else

x3l4:=x3 ;

x3l2:=x3 ;

x3l1:=not x3 ;

x3l3:=not x3 ;

end;

Begin

s3:=Cob13.Items[Cob13.ItemIndex];

if s3 = Конъюнкция (*) then

y3:=and ;

if s3 = Дизъюнкция (+) then

y3:=or ;

if s3 = Исключающее (ИЛИ) then

y3:=xor ;

end;

begin

if Chb14.Checked = true then

begin

x4l4:=not x4 ;

x4l1:=not x4 ;

x4l2:=x4 ;

x4l3:=not x4 ;

end

else

x4l4:=x4 ;

x4l1:=x4 ;

x4l2:=not x4 ;

x4l3:=x4 ;

end;

begin

Label23.Caption:=x1l4+y1+x2l4+y2+x3l4+y3+x4l4;

Label24.Caption:=x1l1+y2+x2l1+y3+x3l1+y1+x3l1;

Label25.Caption:=x1l2+y3+x3l2+y2+x3l2;

Label26.Caption:=x1l3+y1+x2l3+y2+x3l3+y3+x4l3+y1+x1l3;

end; end;

end;TForm2.Button1Click(Sender: TObject);,s2,s3,y1,y2,y3: string;l1,x2l1,x3l1,x4l1:string;l2,x2l2,x3l2,x4l2:string;l3,x2l3,x3l3,x4l3:string;l4,x2l4,x3l4,x4l4:string;

Label30.Caption:=;

Label31.Caption:=;

Label32.Caption:=;

Label33.Caption:=;

if (CoB21.Text=) or (CoB22.Text=) or (CoB23.Text=) then

ShowMessage(Заполните все операции 2 функции!!!)

else

begin

begin

if Chb21.Checked = true then

begin

x1l1:=not x1 ;

x1l2:=x1 ;

x1l3:=not x1 ;

x1l4:=not x1 ;

end

else

x1l4:=x1 ;

x1l1:=x1 ;

x1l3:=x1 ;

x1l2:=not x1 ;

end;

Begin

s1:=Cob21.Items[Cob21.ItemIndex];

if s1 = Конъюнкция (*) then

y1:=and ;

if s1 = Дизъюнкция (+) then

y1:=or ;

if s1 = Исключающее (ИЛИ) then

y1:=xor ;

end;

begin

if Chb22.Checked = true then

begin

x2l4:=not x2 ;

x2l1:=not x2 ;

x2l2:=x2 ;

x2l3:=x2 ;

end

else

x2l4:=x2 ;

x2l2:=not x2 ;

x2l1:=x2 ;

x2l3:=not x2 ;

end;

Begin

s2:=Cob22.Items[Cob22.ItemIndex];

if s2 = Конъюнкция (*) then

y2:=and ;

if s2 = Дизъюнкция (+) then

y2:=or ;

if s2 = Исключающее (ИЛИ) then

y2:=xor ;

end;

begin

if Chb23.Checked = true then

begin

x3l4:=not x3 ;

x3l2:=not x3 ;

x3l1:=x3 ;

x3l3:=not x3 ;

end

else

x3l4:=x3 ;

x3l2:=x3 ;

x3l1:=not x3 ;

x3l3:=not x3 ;

end;

Begin

s3:=Cob23.Items[Cob23.ItemIndex];

if s3 = Конъюнкция (*) then

y3:=and ;

if s3 = Дизъюнкция (+) then

y3:=or ;

if s3 = Исключающее (ИЛИ) then

y3:=xor ;

end;

begin

i