P. 1
sebagian RUMUS DELPHI

sebagian RUMUS DELPHI

|Views: 1,365|Likes:
Published by Abdul Salim
kerja salim
kerja salim

More info:

Published by: Abdul Salim on Jun 03, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

04/22/2013

pdf

text

original

var a, b, c, d, e, f, g, h, i, j : real; x : real; Sgm, StandarDeviasi : Real; Kc : Real; kb : Real; begin a := StrToFloat(Edit1.Text); b := StrToFloat(Edit2.

Text); c := StrToFloat(Edit3.Text); d := StrToFloat(Edit4.Text); e := StrToFloat(Edit5.Text); f := StrToFloat(Edit6.Text); g := StrToFloat(Edit7.Text); h := StrToFloat(Edit8.Text); i := StrToFloat(Edit9.Text); j := StrToFloat(Edit10.Text); //menghitung nilai rata-rata x := (a+b+c+d+e+f+g+h+i+j)/10; Label11.Caption Ratanya Adalah'; := 'Nilai Rata-

Label12.Caption Deviasinya Adalah';

:=

'Standar :=

Edit12.Text FloatToStr(StandarDeviasi); //menghitung nilai terkecil kc := a; if b < kc then kc := b else kc := kc; if c < kc then kc := c else kc := kc; if d < kc then kc := d else kc := kc; if e < kc then kc := e else kc := kc; if f < kc then kc := f else kc := kc; if g < kc then kc := g else kc := kc; if h < kc then kc := h else kc := kc; if i < kc then kc := i else kc := kc; if j < kc then kc := j else kc := kc;

Edit11.Text := FloatToStr(x); //menghitung standar deviasi Sgm := 0; Sgm := sgm+sqr(a-x)+sqr(b-x) +sqr(c-x)+sqr(d-x)+sqr(e-x)+sqr(f-x) +sqr(g-x)+sqr(h-x)+sqr(i-x)+sqr(j-x); StandarDeviasi := sqrt(sgm/9);

Label13.Caption := 'Nilai Terkecil Adalah';

Edit13.Text := FloatToStr(Kc); //menghitung nilai terbesar kb := a; if b > kb then kb := b else kb := kb; if c > kb then kb := c else kb := kb; if d > kb then kb := d else kb := kb; if e > kb then kb := e else kb := kb ; if f > kb then kb := f else kb := kb; if g >kb then kb := g else kb := kb; if h > kb then kb := h else kb := kb; if i > kb then kb := i else kb := kb; if j > kb then kb := j else kb := kb; Label14.Caption Terbesarnya Adalah'; := 'Nilai

procedure TForm1.Button2Click(Sender: TObject); begin Edit1.Clear; Edit2.Clear; DIBUTUHKAN SAMAPAI BERAPA YG

Label11.Caption := ''; Label12.Caption := ''; Label13.Caption := ''; Label14.Caption := ''; form1.color:=clyellow;

LINGKARAN
var r : real; Luas, Keliling, Volume : real; begin r := StrToFloat(Edit1.Text); Keliling := 2*pi*r; // Luas := pi*r*r Luas := pi* sqr(r); // Volume := (4 * pi * r * r * r)/3; Volume := (4 * pi * sqr(r) * r)/3; Edit2.Text := FloatToStr(Keliling); Edit3.Text := FloatToStr(Luas); Edit4.Text := FloatToStr(Volume); // Label2.Font := "Palatino Linotype"; // Label2.Font.Style := 'Bold';

Edit14.Text := FloatToStr(kb); form1.color:=cllime; end;

Label2.Font.Size := 12; Label2.Font.Color := clRed; // Edit2.Font.Size := 12;

case Kode_Bulan of 1,3,5,7,8,10,12 : Label2.Caption := 'Jumlah hari adalah 31 hari'; 4,6,9,11 : Label2.Caption := 'Jumlah hari adalah 30 hari'; 2 : Label2.Caption := 'Jumlah hari adalah 28 atau 29 hari'; else Label2.Caption := memasukkan kode bulan salah...!'; end; // Edit1.SetFocus; TAMBAH BAGI KALI var //x, y, a : byte; x : real; y : real; a : real; begin x := StrToFloat(Edit1.Text); 'Anda yang

DISKON BELANJA
var Belanja, Diskon : Real; NH : Char; begin Belanja := StrToFloat(Edit1.Text); if Belanja < 100000 then Begin Diskon := 0.1*Belanja; Belanja := Belanja - Diskon; end else Begin Diskon := 0.2*Belanja; Belanja := Belanja - Diskon; end; Label2.Caption membayar '; := 'Anda cukup

y := StrToFloat(Edit2.Text); a := x * y; Edit3.Text := FloatToStr(a); end; procedure TForm1.Button2Click(Sender: TObject); var //x, y, a : byte; x : byte;

Edit2.Text := FloatToStr(Belanja); Edit1.SetFocus;

HARI DALAM BULAN
var Kode_Bulan : integer; begin Kode_Bulan := StrToInt(Edit1.Text);

y : byte; a : byte; begin x := StrToInt(Edit1.Text); y := StrToInt(Edit2.Text); a := x div y; Edit3.Text := IntToStr(a); end; procedure TForm1.Button3Click(Sender: TObject); var //x, y, a : byte; x : byte; y : byte; a : byte; begin x := StrToInt(Edit1.Text); y := StrToInt(Edit2.Text); a := x + y; Edit3.Text := IntToStr(a); end; procedure TForm1.Button4Click(Sender: TObject); var //x, y, a : byte; x : byte; y : byte; a : byte;

begin x := StrToInt(Edit1.Text); y := StrToInt(Edit2.Text); a := x - y; Edit3.Text := IntToStr(a); end; procedure TForm1.Button5Click(Sender: TObject); begin Edit1.Clear; Edit2.Clear; Edit3.Clear; end; procedure TForm1.Button6Click(Sender: TObject); begin Application.Terminate; end;

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->