Friday, November 8, 2013

UTS Delphi7


codingnya bro
==========





unit UTS;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    GroupBox1: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    ComboBox1: TComboBox;
    Label9: TLabel;
    Label10: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    GroupBox2: TGroupBox;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Button1: TButton;
    Button2: TButton;
    ComboBox2: TComboBox;
    procedure comboexit1(Sender: TObject);
    procedure comboexit2(Sender: TObject);
    procedure rbutton1click(Sender: TObject);
    procedure rbutton3click(Sender: TObject);
    procedure edit2exit(Sender: TObject);
    procedure edit1exit(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure rbutton2click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.comboexit1(Sender: TObject);
begin
if ComboBox1.text = 'BUS-1' then
 LABEL9.caption :='AC-TOILET'
ELSE IF ComboBox1.Text = 'BUS-2' then
 label9.caption :='SE-21'
ELSE IF ComboBox1.text = 'BUS-3' then
 LABEL9.caption :='EKONOMI'
ELSE
 LABEL9.caption :='EKONOMI-TOILET'
end;

procedure TForm1.comboexit2(Sender: TObject);
begin
IF ComboBox1.Text = 'BUS-1' then
begin
 if ComboBox2.Text = 'SIBOLGA' then
 label10.caption := '120000'
 else if  ComboBox2.Text = 'TARUTUNG' then
 label10.caption := '100000'
 ELSE IF ComboBox2.Text = 'SIBORONG-BORONG' then
 label10.caption := '90000'
 ELSE IF ComboBox2.Text = 'BALIGE' then
 label10.caption := '80000'
 ELSE IF ComboBox2.Text = 'PARAPAT' then
 label10.caption := '60000'
 ELSE
 label10.caption := '0'
END;

If ComboBox1.Text = 'BUS-2' then
begin
 IF ComboBox2.Text = 'PEKANBARU' then
 label10.caption := '200000'
 ELSE IF ComboBox2.Text = 'DUMAI' then
 label10.caption := '180000'
 ELSE IF ComboBox2.Text = 'KANDIS' then
 label10.caption := '170000'
 ELSE IF ComboBox2.Text = 'RANTAU PARAPAT' then
 label10.caption := '100000'
 ELSE
 label10.caption := '0'
END;

IF ComboBox1.Text = 'BUS-3' then
begin
 if ComboBox2.Text = 'SIBOLGA' then
 label10.caption := '100000'
 else if  ComboBox2.Text = 'TARUTUNG' then
 label10.caption := '80000'
 ELSE IF ComboBox2.Text = 'SIBORONG-BORONG' then
 label10.caption := '70000'
 ELSE IF ComboBox2.Text = 'BALIGE' then
 label10.caption := '60000'
 ELSE IF ComboBox2.Text = 'PARAPAT' then
 label10.caption := '40000'
 ELSE IF ComboBox2.Text = 'PARAPAT' then
 label10.caption := '20000'
 ELSE
 label10.caption := '0'
end;

If ComboBox1.Text = 'BUS-4' then
begin
 if ComboBox2.Text = 'P.SIANTAR' then
 label10.caption := '25000'
 else if  ComboBox2.Text = 'PARAPAT' then
 label10.caption := '45000'
 ELSE
 label10.caption := '0'
END;
END;

procedure TForm1.rbutton1click(Sender: TObject);
begin
if RadioButton1.Checked = true then
 label17.caption := '10000';
 label18.caption := inttostr(strtoint(label13.caption) + strtoint(label16.Caption) + strtoint(label17.caption))
end;

procedure TForm1.rbutton2click(Sender: TObject);
begin
if RadioButton2.Checked = true then
 label17.caption := '5000';
 label18.caption := inttostr(strtoint(label13.caption) + strtoint(label16.Caption) + strtoint(label17.caption))
end;

procedure TForm1.rbutton3click(Sender: TObject);
begin
if RadioButton3.Checked = true then
 label17.caption := '0';
 label18.caption := inttostr(strtoint(label13.caption) + strtoint(label16.Caption) + strtoint(label17.caption))
end;

procedure TForm1.edit2exit(Sender: TObject);
begin
if strtoint(edit2.Text) > strtoint(edit1.Text)*100 then
 label16.caption := floattostr((strtofloat(edit2.Text)- strtoint(edit1.Text)*100) *
 (strtofloat(label10.caption)/100))
else
 label16.caption := '0'
end;

procedure TForm1.edit1exit(Sender: TObject);
begin
label13.caption := inttostr(strtoint(edit1.Text) * strtoint(label10.Caption))
end;

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

procedure TForm1.Button1Click(Sender: TObject);
begin
ComboBox1.Text :='';
ComboBox2.Text :='';
edit1.Text :='';
edit2.Text :='';
label9.Caption :='';
label10.Caption :='';
label13.Caption :='';
label16.Caption :='';
label17.Caption :='';
label18.Caption :='';
radiobutton1.Checked := false;
radiobutton2.checked := false;
radiobutton3.checked := false;
end;
end.


=================

nyontek pake skill ya bro....

No comments:

Post a Comment

Popular Posts