Kamis, 13 Oktober 2011

perhitungan hambatan total

 ini perhitungannya, saya ga tau euy cara ngapture gambarnya pake apa ?? :D :D
MySpace

MySpace
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    ER1: TEdit;
    ER2: TEdit;
    ER3: TEdit;
    Ehasil: TEdit;
    Button1: TButton;
    Button2: TButton;
    exit: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure exitClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  R1,R2,R3,RS,RP:real;
begin
  R1:=strtofloat(ER1.text) ;
  R2:=strtofloat(ER2.Text) ;
  R3:=strtofloat(ER3.Text) ;
  RS:=R1+R2+R3 ;
  Ehasil.Text:=floattostr(RS)
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  R1,R2,R3,RS,RP:real;
begin
R1:=strtofloat(ER1.text) ;
  R2:=strtofloat(ER2.Text) ;
  R3:=strtofloat(ER3.Text) ;
  RS:=R1*R2*R3/R1*R2+R1*R3+R2*R3 ;
  Ehasil.text:=floattostr(RP) ;
end;

procedure TForm1.exitClick(Sender: TObject);
begin
close;
end;

end.