Sign in to follow this  
sl@ckw@re

Cálculadora De Décimo Terceiro

Recommended Posts

Componentes necessários:

Label1=SALÀRIO

Label2=MESES DE TRABALHO

Label3=RESULTADO

Button1=CALCULAR

Button2=APAGAR

Button3=SAIR

Código-Fonte:

unit UdecimoTerceiro;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
  StdCtrls;

type

  { TForm2 }

  TForm2 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form2: TForm2;

implementation

{ TForm2 }

procedure TForm2.Button3Click(Sender: TObject);
begin
Form2.Close;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
Edit1.text:='';
Edit2.text:='';
Edit3.text:='';
end;

procedure TForm2.Button1Click(Sender: TObject);
var n1,n2,calculo:real;
begin
n1:=StrToFloat(Edit1.text);
n2:=StrToFloat(Edit2.text);
calculo:=n1*n2/12;
Edit3.text:=FloatToStr(calculo);

end;

initialization
  {$I udecimoterceiro.lrs}

end.

Share this post


Link to post
Share on other sites

Opa

Isto não parece ser uma dúvida, portanto movendo para a seção tutoriais e dicas...

abraço

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this