Помогите сделать курсовик - инженерный калькулятор
Исходник есть а блок схемы и описания нет!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
N3: TMenuItem;
N5: TMenuItem;
N9: TMenuItem;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
Button18: TButton;
Button21: TButton;
Button22: TButton;
Button23: TButton;
Button24: TButton;
Button25: TButton;
Button26: TButton;
Button27: TButton;
Button28: TButton;
Button29: TButton;
Label1: TLabel;
Label2: TLabel;
procedure Button11Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button27Click(Sender: TObject);
procedure Button24Click(Sender: TObject);
procedure Button25Click(Sender: TObject);
procedure Button21Click(Sender: TObject);
procedure Button22Click(Sender: TObject);
procedure Button23Click(Sender: TObject);
procedure Button28Click(Sender: TObject);
procedure Button29Click(Sender: TObject);
procedure Button18Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button26Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N9Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button10Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(9);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(9) else
Edit1.Text:=Edit1.Text+IntToStr(9);
end;
procedure TForm1.Button11Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(0);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(0) else
Edit1.Text:=Edit1.Text+IntToStr(0);
end;
procedure TForm1.Button12Click(Sender: TObject);
Var
s:real;
begin
S:=StrToFloat(Edit1.Text);
If S=0 then Edit1.Text:=IntToStr(0);
If S>0 then Edit1.Text:='-'+Edit1.Text;
if S<0 then
begin
s:= -1*S;
Edit1.Text:=FloatToStr(s);
end;
end;
procedure TForm1.Button13Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+',';
end;
procedure TForm1.Button14Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(4);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button15Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(3);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button16Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(1);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button17Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(2);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button18Click(Sender: TObject);
var
a,b,rezul:Real;
zn:Integer;
begin
b:=StrToFloat(edit1.Text);
a:=StrToFloat(Label1.Caption);
Zn:=StrToInt(Label2.Caption);
if Zn= 1then Rezul:=a+b;
if Zn=2 then Rezul:=a-b;
if Zn=3 then Rezul:=a*b;
if Zn=4 then Rezul:=a / b ;
Edit1.Text:=FloatToStr(Rezul);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Clear;
Edit1.Text:=IntToStr(0);
end;
procedure TForm1.Button21Click(Sender: TObject);
var
Str,S:Real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Sin(Str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button22Click(Sender: TObject);
var
Str,S:real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Cos(Str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button23Click(Sender: TObject);
var
Str,S:real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Sin(Str)/cos(str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button24Click(Sender: TObject);
Var
Str:String;
S:integer;
begin
Str:=Edit1.Text;
S:=StrToInt(Str);
S:=Sqr(S);
Edit1.Text:=IntToStr(S);
end;
procedure TForm1.Button25Click(Sender: TObject);
var
Str:String;
S:integer;
begin
Str:=Edit1.Text;
S:=StrToInt(Str);
S:=Sqr(S)*S;
Edit1.Text:=IntToStr(S);
end;
procedure TForm1.Button26Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(5);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button27Click(Sender: TObject);
var
Str:real;
S:real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Sqrt(Str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button28Click(Sender: TObject);
var
Str,S:real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Ln(Str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button29Click(Sender: TObject);
var
Str:string;
S:integer;
begin
Str:=Edit1.Text;
S:=Length(Str);
s:=s-1;
Edit1.Text:=copy(Edit1.text,1,S);
If s=0 then edit1.Text:=inttostr(0);
end;
procedure TForm1.Button2Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(1);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(1) else
Edit1.Text:=Edit1.Text+IntToStr(1);
end;
procedure TForm1.Button3Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(2);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(2) else
Edit1.Text:=Edit1.Text+IntToStr(2);
end;
procedure TForm1.Button4Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(3);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(3) else
Edit1.Text:=Edit1.Text+IntToStr(3);
end;
procedure TForm1.Button5Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(4);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(4) else
Edit1.Text:=Edit1.Text+IntToStr(4);
end;
procedure TForm1.Button6Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(5);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(5) else
Edit1.Text:=Edit1.Text+IntToStr(5);
end;
procedure TForm1.Button7Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(6);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(6) else
Edit1.Text:=Edit1.Text+IntToStr(6);
end;
procedure TForm1.Button8Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(7);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(7) else
Edit1.Text:=Edit1.Text+IntToStr(7);
end;
procedure TForm1.Button9Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(8);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(8) else
Edit1.Text:=Edit1.Text+IntToStr(8);
end;
procedure TForm1.N5Click(Sender: TObject);
begin
close;
end;
procedure TForm1.N9Click(Sender: TObject);
begin
Form2.ShowModal;
end;
end.
Исходник есть а блок схемы и описания нет!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
N3: TMenuItem;
N5: TMenuItem;
N9: TMenuItem;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
Button18: TButton;
Button21: TButton;
Button22: TButton;
Button23: TButton;
Button24: TButton;
Button25: TButton;
Button26: TButton;
Button27: TButton;
Button28: TButton;
Button29: TButton;
Label1: TLabel;
Label2: TLabel;
procedure Button11Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button27Click(Sender: TObject);
procedure Button24Click(Sender: TObject);
procedure Button25Click(Sender: TObject);
procedure Button21Click(Sender: TObject);
procedure Button22Click(Sender: TObject);
procedure Button23Click(Sender: TObject);
procedure Button28Click(Sender: TObject);
procedure Button29Click(Sender: TObject);
procedure Button18Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button26Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N9Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button10Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(9);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(9) else
Edit1.Text:=Edit1.Text+IntToStr(9);
end;
procedure TForm1.Button11Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(0);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(0) else
Edit1.Text:=Edit1.Text+IntToStr(0);
end;
procedure TForm1.Button12Click(Sender: TObject);
Var
s:real;
begin
S:=StrToFloat(Edit1.Text);
If S=0 then Edit1.Text:=IntToStr(0);
If S>0 then Edit1.Text:='-'+Edit1.Text;
if S<0 then
begin
s:= -1*S;
Edit1.Text:=FloatToStr(s);
end;
end;
procedure TForm1.Button13Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+',';
end;
procedure TForm1.Button14Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(4);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button15Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(3);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button16Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(1);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button17Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(2);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button18Click(Sender: TObject);
var
a,b,rezul:Real;
zn:Integer;
begin
b:=StrToFloat(edit1.Text);
a:=StrToFloat(Label1.Caption);
Zn:=StrToInt(Label2.Caption);
if Zn= 1then Rezul:=a+b;
if Zn=2 then Rezul:=a-b;
if Zn=3 then Rezul:=a*b;
if Zn=4 then Rezul:=a / b ;
Edit1.Text:=FloatToStr(Rezul);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Clear;
Edit1.Text:=IntToStr(0);
end;
procedure TForm1.Button21Click(Sender: TObject);
var
Str,S:Real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Sin(Str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button22Click(Sender: TObject);
var
Str,S:real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Cos(Str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button23Click(Sender: TObject);
var
Str,S:real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Sin(Str)/cos(str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button24Click(Sender: TObject);
Var
Str:String;
S:integer;
begin
Str:=Edit1.Text;
S:=StrToInt(Str);
S:=Sqr(S);
Edit1.Text:=IntToStr(S);
end;
procedure TForm1.Button25Click(Sender: TObject);
var
Str:String;
S:integer;
begin
Str:=Edit1.Text;
S:=StrToInt(Str);
S:=Sqr(S)*S;
Edit1.Text:=IntToStr(S);
end;
procedure TForm1.Button26Click(Sender: TObject);
var
a:real;
begin
Label2.Caption:=IntToStr(5);
a:=StrToFloat(Edit1.Text);
Edit1.Text:='0';
Label1.Caption:=FloatToStr(a);
end;
procedure TForm1.Button27Click(Sender: TObject);
var
Str:real;
S:real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Sqrt(Str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button28Click(Sender: TObject);
var
Str,S:real;
begin
Str:=StrToFloat(Edit1.Text);
S:=Ln(Str);
Edit1.Text:=FloatToStr(S);
end;
procedure TForm1.Button29Click(Sender: TObject);
var
Str:string;
S:integer;
begin
Str:=Edit1.Text;
S:=Length(Str);
s:=s-1;
Edit1.Text:=copy(Edit1.text,1,S);
If s=0 then edit1.Text:=inttostr(0);
end;
procedure TForm1.Button2Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(1);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(1) else
Edit1.Text:=Edit1.Text+IntToStr(1);
end;
procedure TForm1.Button3Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(2);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(2) else
Edit1.Text:=Edit1.Text+IntToStr(2);
end;
procedure TForm1.Button4Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(3);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(3) else
Edit1.Text:=Edit1.Text+IntToStr(3);
end;
procedure TForm1.Button5Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(4);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(4) else
Edit1.Text:=Edit1.Text+IntToStr(4);
end;
procedure TForm1.Button6Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(5);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(5) else
Edit1.Text:=Edit1.Text+IntToStr(5);
end;
procedure TForm1.Button7Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(6);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(6) else
Edit1.Text:=Edit1.Text+IntToStr(6);
end;
procedure TForm1.Button8Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(7);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(7) else
Edit1.Text:=Edit1.Text+IntToStr(7);
end;
procedure TForm1.Button9Click(Sender: TObject);
Var
str:string;
s:integer;
begin
Str:=Edit1.Text;
s:=Length(str);
if s=0 then Edit1.Text:=IntToStr(8);
if StrToInt(Str[1])=0 then Edit1.Text:=IntToStr(8) else
Edit1.Text:=Edit1.Text+IntToStr(8);
end;
procedure TForm1.N5Click(Sender: TObject);
begin
close;
end;
procedure TForm1.N9Click(Sender: TObject);
begin
Form2.ShowModal;
end;
end.