komponen yang dibutuhkan adalah :
1. groupbox 2 buah
2. label
3.edit
4.button..
program ini mengkonversi dari Celcius ke Farenheit dan Reamur:
code lengkapnya :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
GroupBox2: TGroupBox;
Label3: TLabel;
Label4: TLabel;
Edit2: TEdit;
Button1: TButton;
Label5: TLabel;
Edit3: TEdit;
Label7: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var c,r,f,k : real;
begin
c :=strtoint(edit1.Text);
r := 3/4*c;
f := 5/4*c;
edit2.Text :=floattostr(r);
edit3.Text :=floattostr(f);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text :='0';
edit2.Text :='0';
edit3.Text :='0';
end;
end.
