Laman

Kamis, 05 April 2012

PROGRAM 3 WARNA


procedure TForm1.FormCreate(Sender: TObject);
begin
Button1.Caption:='Lime';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if (form1.Color=clgreen) or (form1.Color=clbtnface) then
begin
form1.Color:=cllime;
Button1.Caption:='Kuning';
end
else if form1.Color=cllime then
begin
form1.Color:=clyellow;
Button1.Caption:='Hijau';
end
else if form1.Color=clyellow then
begin
form1.Color:=clgreen;
Button1.Caption:='Lime';
end
end;

end.




PROGRAM BIODATA

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

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit1.Visible:=True;
Edit2.Visible:=True;
RadioButton1.Visible:=True;
RadioButton2.Visible:=True;
ComboBox1.Visible:=True;
ComboBox1.Text:='-Pilih-';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Visible:=false;
Edit2.Visible:=false;
RadioButton1.Visible:=false;
RadioButton2.Visible:=false;
ComboBox1.Visible:=false;
Label6.Caption:=Edit1.Text;
Label7.Caption:=Edit2.Text;
Button2.Enabled:=True;

if RadioButton1.Checked=true then
Label8.Caption:='Laki-Laki';
if RadioButton2.Checked=true then
Label8.Caption:='Perempuan';

if ComboBox1.ItemIndex=0 then
Label9.Caption:='Islam';
if ComboBox1.ItemIndex=1 then
Label9.Caption:='Kristen';
if ComboBox1.ItemIndex=2 then
Label9.Caption:='Katholik';
if ComboBox1.ItemIndex=3 then
Label9.Caption:='Budha';
if ComboBox1.ItemIndex=4 then
Label9.Caption:='Hindu';

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Color:=clActiveCaption;
Form1.Caption:='3113311026';
end;

end.


PROGRAM KALKULATOR

procedure TForm1.Button3Click(Sender: TObject);
begin
Edit3.Text:=FloatToStr(StrToFloat(Edit1.Text)/StrToFloat(Edit2.Text))
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
Edit3.Text:=FloatToStr(StrToFloat(Edit1.Text)*StrToFloat(Edit2.Text))
end;

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

procedure TForm1.Button5Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit3.Text:=FloatToStr(StrToFloat(Edit1.Text)+StrToFloat(Edit2.Text))
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit3.Text:=FloatToStr(StrToFloat(Edit1.Text)-StrToFloat(Edit2.Text))
end;

end.


PROGRAM PENJUALAN

var
  Form1: TForm1;
  var
  harga1,harga2,harga3,tot1,tot2,tot3,total,diskon,uang,bayar,kembali:Currency;
  jml1,jml2,jml3:Integer;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Label2.Caption:=TimeToStr(now);
Label3.Caption:=DateToStr(now);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
ComboBox1.Text:=' -Pilih- ';
ComboBox2.Text:=' -Pilih- ';
ComboBox3.Text:=' -Pilih- ';
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
Edit6.Clear;
Edit7.Clear;
Memo1.Clear;
Memo2.Clear;
Memo3.Clear;
Memo4.Clear;
Memo5.Clear;
Memo6.Clear;
Button2.Visible:=False;
Button3.Visible:=False;
Button4.Visible:=False;
Form1.Color:=clHighlight;
Panel2.Color:=clActiveBorder;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
harga1:=StrToInt(Edit1.Text);
harga2:=StrToInt(Edit2.Text);
harga3:=StrToInt(Edit3.Text);
jml1:=StrToInt(Edit4.Text);
jml2:=StrToInt(Edit5.Text);
jml3:=StrToInt(Edit6.Text);
tot1:=harga1*jml1;
tot2:=harga2*jml2;
tot3:=harga3*jml3;
Memo1.Text:=CurrToStr(tot1);
Memo2.Text:=CurrToStr(tot2);
Memo3.Text:=CurrToStr(tot3);
total:=tot1+tot2+tot3;
Memo4.Text:=CurrToStr(total);
Button2.Visible:=True;
Button3.Visible:=True;
Button4.Visible:=True;

total:=StrToCurr(Memo4.Text);
if total>=500000 then
diskon:=50000
else diskon:=10000;
Memo5.Text:=CurrToStr(diskon);
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
if ComboBox1.ItemIndex=0 then
harga1:=300000
else if ComboBox1.ItemIndex=1 then
harga1:=400000
else if ComboBox1.ItemIndex=2 then
harga1:=500000;
Edit1.Text:=CurrToStr(harga1);
end;

procedure TForm1.ComboBox2Change(Sender: TObject);
begin
if ComboBox2.ItemIndex=0 then
harga2:=5000
else if ComboBox2.ItemIndex=1 then
harga2:=4000
else if ComboBox2.ItemIndex=2 then
harga2:=4500;
Edit2.Text:=CurrToStr(harga2);
end;

procedure TForm1.ComboBox3Change(Sender: TObject);
begin
if ComboBox3.ItemIndex=0 then
harga3:=4000
else if ComboBox3.ItemIndex=1 then
harga3:=9000
else if ComboBox3.ItemIndex=2 then
harga3:=10000;
Edit3.Text:=CurrToStr(harga3);
end;

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

procedure TForm1.Button2Click(Sender: TObject);
begin
Memo6.Text:=CurrToStr(StrToCurr(Edit7.Text)-(StrToCurr(Memo4.Text)-StrToCurr(Memo5.Text)))
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
ComboBox1.Text:=' -Pilih- ';
ComboBox2.Text:=' -Pilih- ';
ComboBox3.Text:=' -Pilih- ';
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
Edit6.Clear;
Edit7.Clear;
Memo1.Clear;
Memo2.Clear;
Memo3.Clear;
Memo4.Clear;
Memo5.Clear;
Memo6.Clear;
Button2.Visible:=False;
Button3.Visible:=False;
Button4.Visible:=False;
end;

end.


PROGRAM NILAI AKHIR

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

procedure TForm1.Button1Click(Sender: TObject);
begin
FormCreate(sender);
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
Edit6.Clear;
Edit7.Clear;
Edit8.Clear;
ComboBox1.Text:='-Pilih-';
Button3.Visible:=True;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
hasil:real;
nilai:string;
begin
label10.Caption:=floattostr(((strtofloat(Edit1.Text)+strtofloat(Edit2.Text)+strtofloat(Edit3.Text))/3)*0.1);
label11.Caption:=floattostr(((strtofloat(Edit4.Text)+strtofloat(Edit5.Text))/2)*0.1);
label12.Caption:=floattostr(((strtofloat(combobox1.Text))/14)*10);
label13.Caption:=floattostr((strtofloat(Edit6.Text))*0.3);
label14.Caption:=floattostr((strtofloat(Edit7.Text))*0.4);
hasil:=(strtofloat(label10.Caption)+strtofloat(label11.Caption)+strtofloat(label12.Caption)+strtofloat(label13.Caption)+strtofloat(label14.Caption));
str(hasil:0:2,nilai);
Edit8.Text:=(nilai);

Button1.Visible:=True;
Button3.Visible:=True;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
label10.Visible:=false;
label11.Visible:=false;
label12.Visible:=false;
label13.Visible:=false;
label14.Visible:=false;
Form1.Color:=clskyblue;
Form1.Caption:='3113311026';
Button1.Visible:=False;
Button3.Visible:=False;
end;

end.

0 komentar:

Posting Komentar

 
ans!!
Top