You are on page 1of 12

Project 1

Pertemuan 4

Membuat Form LOGIN

procedure TForm1.Button1Click(Sender: TObject);

begin
if (edit1.Text = 'admin') and (edit2.Text = 'admin')
then form2.Show
else
application.MessageBox('Maaf Username dan
Password anda salah','warning',0);
exit;
end;

procedure TForm1.Button2Click(Sender: TObject);

begin
application.Terminate;
end;

User interface

Coding 1
procedure TForm2.Button1Click(Sender: TObject);
var
total:integer;
begin
total:=0;
if CB_nasgor.Checked=true then
total:=total+7000;
if CB_Batagor.Checked then
total:=total+6000;

if CB_capcai.Checked then
total:=total+8000;
if CB_ayam.Checked then
total:=total+5000;
if CB_sate.Checked then
total:=total+7000;

if CB_mie.Checked then
total:=total+6000;
if CB_jus.Checked then
total:=total+6000;
if CB_teh.Checked then
total:=total+2000;
if CB_kopi.Checked then
total:=total+2000;

if CB_susu.Checked then
total:=total+3000;
if CB_minring.Checked then
total:=total+7000;
if CB_escam.Checked then
total:=total+6000;
edit1.Text:=inttostr(total);
end;

User interface

Form2

Caption
Position

Struktur SELECTCASE
poScreenCenter

RadioGroup1

Caption
Items

Jurusan

Label1

Caption

Harga

Edit1

Text

<kosong>

BitBtn1

Caption

Cari Harga

Cicadas
Binong
Riung Bandung
St.Hall
Ledeng
Lembang

Coding
procedure TForm1.Button1Click(Sender: TObject);
begin
case RadioGroup1.ItemIndex of
0:edit1.Text:='2000';
1:edit1.Text:='2500';
2:edit1.Text:='5000';
3:edit1.Text:='4000';
4:edit1.Text:='3000';
5:edit1.Text:='7000';
else
edit1.Text:='0';
end;
end;
end.

You might also like