ALGORITMA
ALGORITMA
ALGORITMA
B. GAMBAR APLIKASI
D. SOURCE CODE
unit Unit1;
interface
interface
uses
Windows, Messages, SysUtils,
Variants, Classes, Graphics,
Controls, Forms,
Dialogs, StdCtrls, Buttons,
ExtCtrls;
uses
Windows, Messages, SysUtils,
Variants, Classes, Graphics,
Controls, Forms,
Dialogs, StdCtrls;
type
TTOMY1 = class(TForm)
Label1: TLabel;
Button1: TButton;
procedure
Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
TOMY1: TTOMY1;
implementation
uses Unit2;
{$R *.dfm}
procedure
TTOMY1.Button1Click(Sender:
TObject);
begin
TOMY1.Hide;
TOMY2.show;
end;
end.
unit Unit2;
type
TTOMY2 = class(TForm)
Label10: TLabel;
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Edit1: TEdit;
Edit2: TEdit;
TOMY3: TEdit;
ComboBox1: TComboBox;
Panel2: TPanel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
TSPEEDBUTTON:
TSpeedButton;
TOMY4: TEdit;
TOMY5: TEdit;
Button1: TButton;
TOMY6: TEdit;
TOMY7: TEdit;
TOMY8: TEdit;
Button2: TButton;
procedure
ComboBox1Change(Sender:
TObject);
procedure
Button1Click(Sender: TObject);
procedure
Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
TOMY2: TTOMY2;
implementation
uses Unit1, Unit5;
{$R *.dfm}
function hitung(var
b,a:integer):integer;
begin
hitung:=b-a;
end;
procedure
TTOMY2.ComboBox1Change(S
ender: TObject);
begin
case combobox1.itemindex of
0:TOMY3.Text:='2320';
1:TOMY3.Text:='4350';
2:TOMY3.Text:='5800';
3:TOMY3.Text:='7250';
4:TOMY3.Text:='13050';
end;
end;
procedure
TTOMY2.Button1Click(Sender:
TObject);
var
stand_awal,stand_akhir,hsl:int
eger;
begin
stand_awal:=strtoint(TOMY4.te
xt);
stand_akhir:=strtoint(TOMY5.t
ext);
hsl:=hitung(stand_akhir,stand_
awal);
TOMY6.Text:=floattostr(hsl);
end;
procedure
TTOMY2.Button2Click(Sender:
TObject);
var
a,b,c,d:real;
begin
a:=strtofloat(TOMY6.text);
b:=strtofloat(TOMY3.text);
c:=strtofloat(TOMY7.text);
d:=(a*b);
TOMY8.text:=floattostr(d);
end;
end.