Advertisement
ViciadoEmLinux1987

Calculadora de decimo terceiro salário

Mar 11th, 2023
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.43 KB | None | 0 0
  1.  unit Unit1;
  2.  
  3.     {$mode objfpc}{$H+}
  4.  
  5.  
  6.     interface
  7.  
  8.     uses
  9.  
  10.  
  11.      Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
  12.  
  13.  
  14.     type
  15.  
  16.  
  17.  
  18.      { TForm1 }
  19.  
  20.  
  21.      TForm1 = class(TForm)
  22.  
  23.  
  24.      Calcular: TButton;
  25.  
  26.  
  27.      Apagar: TButton;
  28.  
  29.  
  30.      Edit1: TEdit;
  31.  
  32.  
  33.      Edit2: TEdit;
  34.  
  35.  
  36.      Edit3: TEdit;
  37.  
  38.  
  39.      Sair: TButton;
  40.  
  41.  
  42.      procedure ApagarClick(Sender: TObject);
  43.  
  44.  
  45.      procedure CalcularClick(Sender: TObject);
  46.  
  47.  
  48.      procedure SairClick(Sender: TObject);
  49.  
  50.  
  51.      private
  52.  
  53.  
  54.      { private declarations }
  55.  
  56.  
  57.      public
  58.  
  59.  
  60.      { public declarations }
  61.  
  62.  
  63.      end;
  64.  
  65.  
  66.     var
  67.  
  68.  
  69.      Form1: TForm1;
  70.  
  71.  
  72.    
  73.  
  74.  
  75.     implementation
  76.  
  77.  
  78.    
  79.  
  80.  
  81.     { TForm1 }
  82.  
  83.  
  84.    
  85.  
  86.  
  87.     procedure TForm1.CalcularClick(Sender: TObject);
  88.  
  89.  
  90.     var n1,n2,resultado:real;//n1(numero1),n2(numero2),resultado(resultado do calculo)
  91.  
  92.  
  93.     begin
  94.  
  95.  
  96.     n1:=StrToFloat(Edit1.text);
  97.  
  98.  
  99.     n2:=StrToFloat(Edit2.text);
  100.  
  101.  
  102.     resultado:=n1*n2/12;
  103.  
  104.  
  105.     Edit3.text:=FloatToStr(resultado);
  106.  
  107.  
  108.    
  109.  
  110.  
  111.     end;
  112.  
  113.  
  114.    
  115.  
  116.  
  117.     procedure TForm1.SairClick(Sender: TObject);
  118.  
  119.  
  120.     begin
  121.  
  122.  
  123.      Form1.Close;
  124.  
  125.  
  126.     end;
  127.  
  128.  
  129.    
  130.  
  131.  
  132.     procedure TForm1.ApagarClick(Sender: TObject);
  133.  
  134.  
  135.     begin
  136.  
  137.  
  138.      Edit1.text:='';
  139.  
  140.  
  141.      Edit2.text:='';
  142.  
  143.  
  144.      Edit3.Text:='';
  145.  
  146.  
  147.     end;
  148.  
  149.  
  150.    
  151.  
  152.  
  153.     initialization
  154.  
  155.  
  156.      {$I unit1.lrs}
  157.  
  158.  
  159.    
  160.  
  161.  
  162.     end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement