Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
- type
- TForm1 = class(TForm)
- GroupBox1: TGroupBox;
- GroupBox2: TGroupBox;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- RadioButton3: TRadioButton;
- RadioButton4: TRadioButton;
- RadioButton5: TRadioButton;
- RadioButton6: TRadioButton;
- Label1: TLabel;
- Label2: TLabel;
- Edit1: TEdit;
- Edit2: TEdit;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- Edit3: TEdit;
- Edit4: TEdit;
- Edit5: TEdit;
- Edit6: TEdit;
- Edit7: TEdit;
- Edit8: TEdit;
- GroupBox3: TGroupBox;
- CheckBox1: TCheckBox;
- CheckBox2: TCheckBox;
- CheckBox3: TCheckBox;
- CheckBox4: TCheckBox;
- Button1: TButton;
- Button2: TButton;
- Button3: TButton;
- procedure FormCreate(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure RadioButton1Click(Sender: TObject);
- procedure RadioButton2Click(Sender: TObject);
- procedure RadioButton3Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure CheckBox1Click(Sender: TObject);
- procedure CheckBox2Click(Sender: TObject);
- procedure CheckBox3Click(Sender: TObject);
- procedure CheckBox4Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- procedure bersih;
- procedure trumah;
- procedure Ftam;
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.trumah;
- begin
- if RadioButton1.Checked=True then begin
- edit1.Text:='130000000';
- edit2.Text:='14';
- end;
- if RadioButton2.Checked=True then begin
- edit1.Text:='90000000';
- edit2.Text:='12';
- end;
- if RadioButton3.Checked=True then begin
- edit1.Text:='56000000';
- edit2.Text:='10';
- end;
- end;
- procedure TForm1.Ftam;
- begin
- if CheckBox1.Checked=True then begin
- Edit1.Text:=IntTostr(StrToInt(Edit1.Text)+600000);
- EXIT;
- end
- else if CheckBox1.Checked=False then begin
- Edit1.Text:=IntTostr(StrToInt(Edit1.Text)-600000);
- EXIT;
- end;
- if CheckBox2.Checked=True then begin
- Edit1.Text:=IntTostr(StrToInt(Edit1.Text)+3500000);
- EXIT;
- end
- else if CheckBox2.Checked=False then begin
- Edit1.Text:=IntTostr(StrToInt(Edit1.Text)-3500000);
- EXIT;
- end;
- if CheckBox3.Checked=True then begin
- Edit1.Text:=IntTostr(StrToInt(Edit1.Text)+2000000);
- EXIT;
- end
- else if CheckBox3.Checked=False then begin
- Edit1.Text:=IntTostr(StrToInt(Edit1.Text)-2000000);
- EXIT;
- end;
- end;
- procedure TForm1.bersih;
- begin
- Edit1.Clear;
- Edit1.Text:='0';
- Edit2.Clear;
- Edit2.Text:='0';
- Edit3.Clear;
- Edit3.Text:='0';
- Edit4.Clear;
- Edit5.Clear;
- Edit6.Clear;
- Edit7.Clear;
- Edit8.Clear;
- RadioButton1.Checked:=False;
- RadioButton2.Checked:=False;
- RadioButton3.Checked:=False;
- RadioButton4.Checked:=False;
- RadioButton5.Checked:=False;
- RadioButton6.Checked:=False;
- CheckBox1.Checked:=False;
- CheckBox2.Checked:=False;
- CheckBox3.Checked:=False;
- CheckBox4.Checked:=False;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- bersih;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- var Hutang,Harga,Fasilitas,
- UangMuka,SukuBunga,HutangBunga,
- TotalHutang, Ansuran, JangkaKredit:Currency;
- //SukuBunga,HutangBunga:Real;
- begin
- if Length(Edit4.Text)=0 then begin
- application.MessageBox('Uang Mukanya Belum Diisi'+#13+
- 'Silahkan Isikan dulu Uang Mukanya','Cek Pengisian...',MB_ICONWARNING);
- Edit4.SetFocus;
- EXIT;
- end;
- Harga:=StrToInt(Edit1.Text);
- Fasilitas:=StrToInt(Edit3.Text);
- UangMuka:=StrToCurr(Edit4.Text);
- Hutang:=Harga + Fasilitas - UangMuka;
- Edit5.Text:=CurrToStr(Hutang);
- SukuBunga:=StrToCurr(Edit2.Text)/100;
- if RadioButton4.Checked=True then begin
- HutangBunga:=Hutang * SukuBunga * 15;
- end
- else if RadioButton4.Checked=True then begin
- HutangBunga:=Hutang * SukuBunga * 10;
- end
- else if RadioButton4.Checked=True then begin
- HutangBunga:=Hutang * SukuBunga * 5;
- end;
- Edit6.Text:=CurrToStr(HutangBunga);
- TotalHutang:= Hutang + HutangBunga;
- Edit7.Text:=CurrToStr(TotalHutang);
- if RadioButton4.Checked=True then begin
- JangkaKredit:= 15;
- end
- else if RadioButton4.Checked=True then begin
- JangkaKredit:= 10;
- end
- else if RadioButton4.Checked=True then begin
- JangkaKredit:= 5;
- end;
- Ansuran:=TotalHutang / (JangkaKredit * 12);
- Edit8.Text:=CurrToStr(Ansuran);
- end;
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- close;
- end;
- procedure TForm1.CheckBox1Click(Sender: TObject);
- begin
- if CheckBox1.Checked=True then begin
- Edit3.Text:=IntTostr(StrToInt(Edit3.Text)+600000);
- EXIT;
- end
- else if CheckBox1.Checked=False then begin
- Edit3.Text:=IntTostr(StrToInt(Edit3.Text)-600000);
- EXIT;
- end;
- end;
- procedure TForm1.CheckBox2Click(Sender: TObject);
- begin
- if CheckBox2.Checked=True then begin
- Edit3.Text:=IntTostr(StrToInt(Edit3.Text)+3500000);
- EXIT;
- end
- else if CheckBox2.Checked=False then begin
- Edit3.Text:=IntTostr(StrToInt(Edit3.Text)-3500000);
- EXIT;
- end;
- end;
- procedure TForm1.CheckBox3Click(Sender: TObject);
- begin
- if CheckBox3.Checked=True then begin
- Edit3.Text:=IntTostr(StrToInt(Edit3.Text)+2000000);
- EXIT;
- end
- else if CheckBox3.Checked=False then begin
- Edit3.Text:=IntTostr(StrToInt(Edit3.Text)-2000000);
- EXIT;
- end;
- end;
- procedure TForm1.CheckBox4Click(Sender: TObject);
- begin
- if CheckBox4.Checked=True then begin
- Edit3.Text:=IntTostr(StrToInt(Edit3.Text)+4500000);
- EXIT;
- end
- else if CheckBox4.Checked=False then begin
- Edit3.Text:='0';
- EXIT;
- end;
- end;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- bersih;
- end;
- procedure TForm1.RadioButton1Click(Sender: TObject);
- begin
- trumah;
- end;
- procedure TForm1.RadioButton2Click(Sender: TObject);
- begin
- trumah;
- end;
- procedure TForm1.RadioButton3Click(Sender: TObject);
- begin
- trumah;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement