Advertisement
Pastinator666ULTRA

Calculator v.1 by moya vchitelka!

Apr 9th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.30 KB | None | 0 0
  1. unit kalkuljator;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
  6. StdCtrls;
  7. type
  8. { TForm1 }
  9. TForm1 = class(TForm)
  10. Button1: TButton;
  11. Button2: TButton;
  12. Button3: TButton;
  13. Button4: TButton;
  14. Edit1: TEdit;
  15. Edit2: TEdit;
  16. Edit3: TEdit;
  17. procedure Button1Click(Sender: TObject);
  18. procedure Button2Click(Sender: TObject);
  19. procedure Button3Click(Sender: TObject);
  20. procedure Button4Click(Sender: TObject);
  21. private
  22. { private declarations }
  23. public
  24. { public declarations }
  25. end;
  26. var
  27. Form1: TForm1;
  28. implementation
  29. {$R *.lfm}
  30. { TForm1 }
  31. procedure TForm1.Button1Click(Sender: TObject);
  32. var a,b,vidp:real;
  33. begin
  34. a:=strtofloat(edit1.text);
  35. b:=strtofloat(edit2.text);
  36. vidp:=a+b;
  37. edit3.text:=floattostr(vidp);
  38. end;
  39. procedure TForm1.Button2Click(Sender: TObject);
  40. var a,b,vidp:real;
  41. begin
  42. a:=strtofloat(edit1.text);
  43. b:=strtofloat(edit2.text);
  44.  
  45. vidp:=a-b;
  46. edit3.text:=floattostr(vidp);
  47. end;
  48. procedure TForm1.Button3Click(Sender: TObject);
  49. var a,b,vidp:real;
  50. begin
  51. a:=strtofloat(edit1.text);
  52. b:=strtofloat(edit2.text);
  53. vidp:=a*b;
  54. edit3.text:=floattostr(vidp);
  55. end;
  56. procedure TForm1.Button4Click(Sender: TObject);
  57. var a,b,vidp:real;
  58. begin
  59. a:=strtofloat(edit1.text);
  60. b:=strtofloat(edit2.text);
  61. vidp:=a/b;
  62. edit3.text:=floattostr(vidp);
  63. end;
  64. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement