Разработка приложения "Базовые логические операции"
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
=not x4 ;
x4l1:=not x4 ;
x4l2:=x4 ;
x4l3:=not x4 ;
end
else
x4l4:=x4 ;
x4l1:=x4 ;
x4l2:=not x4 ;
x4l3:=x4 ;
end;
begin
Label42.Caption:=x1l4+y1+x2l4+y2+x3l4+y3+x4l4;
Label45.Caption:=x1l1+y2+x2l1+y3+x3l1+y1+x3l1;
Label43.Caption:=x1l2+y3+x3l2+y2+x3l2;
Label44.Caption:=x1l3+y1+x2l3+y2+x3l3+y3+x4l3+y1+x1l3;
end;
end;
end;TForm2.Button6Click(Sender: TObject);: Variant;
if (Label23.Caption=) or (Label30.Caption=) or (Label34.Caption=) or (Label38.Caption=) or( Label42.Caption=) then
showmessage(Заполните все функции!)
else
begin
try
MSWord:=CreateOleObject(Word.Application);
MSWord.Visible:=true;
except
Exception.Create(Error);
end;
MSWord.Documents.Add;
MSWord.Selection.Font.Size := 10;
MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter;
MSWord.Selection.TypeText(Memo1.Text);
MSWord.Selection.Font.Size := 12;
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphLeft;
MSWord.Selection.TypeText(Memo2.Text);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Домашнее задание);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Вариант 1);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label23.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label30.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label34.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label38.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label42.Caption);
MSWord.Selection.InsertNewPage;
//.............................
MSWord.Selection.Font.Size := 10;
MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter;
MSWord.Selection.TypeText(Memo1.Text);
MSWord.Selection.Font.Size := 12;
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphLeft;
MSWord.Selection.TypeText(Memo2.Text);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Домашнее задание);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Вариант 2);
MSWord.Selection.Font.Bold := false;
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.Font.Size := 12;
MSWord.Selection.TypeText(Label24.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label31.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label35.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label39.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label43.Caption);
MSWord.Selection.InsertNewPage;
//.............................
MSWord.Selection.Font.Size := 10;
MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter;
MSWord.Selection.TypeText(Memo1.Text);
MSWord.Selection.Font.Size := 12;
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphLeft;
MSWord.Selection.TypeText(Memo2.Text);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Домашнее задание);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Вариант 3);
MSWord.Selection.Font.Bold := false;
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.Font.Size := 12;
MSWord.Selection.TypeText(Label25.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label32.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label36.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label40.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label44.Caption);
MSWord.Selection.InsertNewPage;
//.............................
MSWord.Selection.Font.Size := 10;
MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphCenter;
MSWord.Selection.TypeText(Memo1.Text);
MSWord.Selection.Font.Size := 12;
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.ParagraphFormat.Alignment:=wdAlignParagraphLeft;
MSWord.Selection.TypeText(Memo2.Text);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Домашнее задание);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Вариант 4);
MSWord.Selection.Font.Bold := false;
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.Font.Size := 12;
MSWord.Selection.TypeText(Label26.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label33.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label37.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label41.Caption);
MSWord.Selection.TypeText(#13#10);
MSWord.Selection.TypeText(Label45.Caption);
MSWord.ActiveDocument.SaveAs(C:\Lab_rab.doc);
end;; TForm2.Button7Click(Sender: TObject);
var
f1,f2,f3,f4: Textfile;
begin
if (Label23.Caption=) or (Label30.Caption=) or (Label34.Caption=) or (Label38.Caption=) or( Label42.Caption=) then
showmessage(Заполните все функции!)
else
begin
AssignFile(f1, lab_rab\var1.txt);
AssignFile(f2, lab_rab\var2.txt);
AssignFile(f3, lab_rab\var3.txt);
AssignFile(f4, lab_rab\var4.txt);
ReWrite(f1);
ReWrite(f2);
ReWrite(f3);
ReWrite(f4);
Writeln(f1,Label23.Caption);
Writeln(f1,Label30.Caption);
Writeln(f1,Label34.Caption);
Writeln(f1,Label38.Caption);
Writeln(f1,Label42.Caption);
////////////////////////////
Writeln(f2,Label24.Caption);
Writeln(f2,Label31.Caption);
Writeln(f2,Label35.Caption);
Writeln(f2,Label39.Caption);
Writeln(f2,Label43.Caption);
////////////////////////////
Writeln(f3,Label25.Caption);
Writeln(f3,Label32.Caption);
Writeln(f3,Label36.Caption);
Writeln(f3,Label30.Caption);
Writeln(f3,Label44.Caption);
///////////////////////////
Writeln(f4,Label26.Caption);
Writeln(f4,Label33.Caption);
Writeln(f4,Label37.Caption);
Writeln(f4,Label41.Caption);
Writeln(f4,Label45.Caption);
Closefile(f1);
Closefile(f2);
Closefile(f3);
Closefile(f4);
end;
end;.
Листинг программы (Unit3).Unit3;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, XPMan, Menus;
TForm3 = class(TForm)
XPManifest1: TXPManifest;
Panel1: TPanel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Memo1: TMemo;
Memo2: TMemo;
Button2: TButton;
Label1: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Form3: TForm3;Unit4;
{$R *.dfm}prov (s,s1:string):integer;:integer;:=0;
for i:=1 to 16 do
begin
if s[i]<>s1[i] then
result:=result+1;
end;;element( var s:string):integer;,n:integer;:=length(s);s[1]=x then
begin
n:=StrToInt(s[2]);
result:=2*n-1;
s:=copy(s,4,l-3);
end
else
begin
n:=StrToInt(s[6]);
result:=2*n;
s:=copy(s,8,l-7);
end;;oper(var s:string):integer;:integer;
l:=length(s);
if s[1]=a then
begin
result:=1;
s:=copy(s,5,l-4);
end
else
if s[1]=o then
begin
result:=2;
s:=copy(s,4,l-3);
end
else
begin
result:=3;
s:=copy(s,5,l-4);
end;;Bin(x: Integer): string;t:array