Advertisement
jacob_segundo

fahrenheit celsius delphi7

Mar 17th, 2021
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.72 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     fahrenhite: TLabel;
  12.     Label2: TLabel;
  13.     Edit1: TEdit;
  14.     Edit2: TEdit;
  15.     coversao: TButton;
  16.     procedure coversaoClick(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.   temperatura: real;
  26.   fahrenhitee: real;
  27.   celsius: real;
  28.  
  29. implementation
  30.  
  31. {$R *.dfm}
  32.  
  33. procedure TForm1.coversaoClick(Sender: TObject);
  34. begin
  35.   fahrenhitee:= strtofloat(edit1.Text);
  36.   temperatura:= fahrenhitee -32;
  37.   celsius:=temperatura/1.8;
  38.   Edit2.Text:=floattostr(celsius);
  39. end;
  40.  
  41. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement