14 Kasım 2013 Perşembe

Delphide Hesap Makinesi

delphi
delphi
unit Unit5;

interface

.....
....

.....
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;
  degisken:string;
  sayibir:Integer;
  sayiiki:Integer;

implementation

{$R *.dfm}

procedure TForm5.Button10Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(0);
end;

procedure TForm5.Button11Click(Sender: TObject);
begin
degisken:='+';
if sayibir<=0 then
begin
sayibir:=StrToInt(Edit1.Text);
Edit1.Text:='';
end
else
begin
sayiiki:=StrToInt(Edit1.Text);
Button11.Visible:=False;
Button12.Visible:=False;
Button13.Visible:=False;
Button14.Visible:=False;
Button15.Visible:=True;
Edit1.Text:='';
end;
end;

procedure TForm5.Button12Click(Sender: TObject);
begin
degisken:='-';
if sayibir<=0 then
begin
sayibir:=StrToInt(Edit1.Text);
Edit1.Text:='';
end
else
begin
sayiiki:=StrToInt(Edit1.Text);
Button11.Visible:=False;
Button12.Visible:=False;
Button13.Visible:=False;
Button14.Visible:=False;
Button15.Visible:=True;
Edit1.Text:='';
end;
end;

procedure TForm5.Button13Click(Sender: TObject);
begin
degisken:='*';
if sayibir<=0 then
begin
sayibir:=StrToInt(Edit1.Text);
Edit1.Text:='';
end
else
begin
sayiiki:=StrToInt(Edit1.Text);
Button11.Visible:=False;
Button12.Visible:=False;
Button13.Visible:=False;
Button14.Visible:=False;
Button15.Visible:=True;
Edit1.Text:='';
end;
end;

procedure TForm5.Button14Click(Sender: TObject);
begin
degisken:='/';
if sayibir<=0 then
begin
sayibir:=StrToInt(Edit1.Text);
Edit1.Text:='';
end
else
begin
sayiiki:=StrToInt(Edit1.Text);
Button11.Visible:=False;
Button12.Visible:=False;
Button13.Visible:=False;
Button14.Visible:=False;
Button15.Visible:=True;
Edit1.Text:='';
end;
end;

procedure TForm5.Button15Click(Sender: TObject);
var
sonuc,num:Integer;
begin
if degisken='+' then
   begin
        Edit1.Text:=FloatToStr(sayibir+sayiiki);
   end;
 if degisken='-' then
     begin
          Edit1.Text:=FloatToStr(sayibir-sayiiki);
     end;
if degisken='*' then
begin
  Edit1.Text:=FloatToStr(sayibir*sayiiki);
end;
 if degisken='/' then
 begin  Edit1.Text:=FloatToStr(sayibir/sayiiki);
 end;
     num:=MessageDlg('Tekrar İşlem Yapmak İstermisiniz ?',mtInformation,[mbYes,mbNo],0);
        case num of
        6:
        begin
          Button11.Visible:=True;
          Button12.Visible:=True;
          Button13.Visible:=True;
          Button14.Visible:=True;
          Button15.Visible:=False;
          Edit1.Text:='';
        end;
        7:Form5.Free;
        else
        ShowMessage('Tanımlanmayan değer !');
        end;
end;

procedure TForm5.Button1Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(1);
end;

procedure TForm5.Button2Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(2);
end;

procedure TForm5.Button3Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(3);
end;

procedure TForm5.Button4Click(Sender: TObject);
begin
     Edit1.Text:=Edit1.Text+FloatToStr(4);
end;

procedure TForm5.Button5Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(5);
end;

procedure TForm5.Button6Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(6);
end;

procedure TForm5.Button7Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(7);
end;

procedure TForm5.Button8Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(8);
end;

procedure TForm5.Button9Click(Sender: TObject);
begin
Edit1.Text:=Edit1.Text+FloatToStr(9);
end;

end.



delphi
delphi


0 yorum :

Yorum Gönder