Langkah-langkahnya adalah sebagai berikut :
- Klik tombol Start>All Programs > Pilih Delphi 7
- Windows Delphi 7 akan muncul
- setelah itu klik menu File > New> pilih Application maka akan muncul form 1
- Buatlah desain sesuai yang anda perlukan
- Masukkanlah coding dibawah ini ke tombol Proses
- Jika anda tidak ingin program berjalan secara otomatis maka anda cukup menghilangkan setiap kode "begin" dibawah ini.
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
if (combobox1.text='D') and (radiobutton1.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if (combobox1.text='S') and (radiobutton1.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if (combobox1.text='M') and (radiobutton1.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if (combobox1.text='D') and (radiobutton2.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if (combobox1.text='S') and (radiobutton2.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if (combobox1.text='M') and (radiobutton2.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if (combobox1.text='D') and (radiobutton3.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if (combobox1.text='S')and (radiobutton3.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if (combobox1.text='M') and (radiobutton3.checked)then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
edit4.Text:=floattostr(strtofloatdef(edit3.text,0)*(strtofloatdef(edit2.Text,0)));
if(strtofloatdef(edit4.Text,0)>200000) then
begin
edit5.text:=floattostr(strtofloatdef(edit4.Text,0)*0.05);
edit6.text:=floattostr((strtofloatdef(edit4.Text,0)-strtofloatdef(edit5.Text,0)));
end
else
edit5.text:='0';
edit6.text:=floattostr((strtofloatdef(edit4.text,0)-strtofloatdef(edit5.text,0)));
if(strtofloatdef(edit2.text,0)<0) then
begin
edit4.Text:='INPUT SALAH';
edit5.Text:='0';
edit6.Text:='INPUT SALAH';
end;
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
if (combobox1.text='D') and (radiobutton1.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if (combobox1.text='S') and (radiobutton1.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if (combobox1.text='M') and (radiobutton1.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if (combobox1.text='D') and (radiobutton2.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if (combobox1.text='S') and (radiobutton2.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if (combobox1.text='M') and (radiobutton2.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if (combobox1.text='D') and (radiobutton3.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if (combobox1.text='S')and (radiobutton3.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if (combobox1.text='M') and (radiobutton3.checked)then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
edit4.Text:=floattostr(strtofloatdef(edit3.text,0)*(strtofloatdef(edit2.Text,0)));
if(strtofloatdef(edit4.Text,0)>200000) then
begin
edit5.text:=floattostr(strtofloatdef(edit4.Text,0)*0.05);
edit6.text:=floattostr((strtofloatdef(edit4.Text,0)-strtofloatdef(edit5.Text,0)));
end
else
edit5.text:='0';
edit6.text:=floattostr((strtofloatdef(edit4.text,0)-strtofloatdef(edit5.text,0)));
if(strtofloatdef(edit2.text,0)<0) then
begin
edit4.Text:='INPUT SALAH';
edit5.Text:='0';
edit6.Text:='INPUT SALAH';
end;
end;
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
if (combobox1.text='D') and (radiobutton1.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if (combobox1.text='S') and (radiobutton1.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if (combobox1.text='M') and (radiobutton1.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if (combobox1.text='D') and (radiobutton2.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if (combobox1.text='S') and (radiobutton2.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if (combobox1.text='M') and (radiobutton2.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if (combobox1.text='D') and (radiobutton3.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if (combobox1.text='S')and (radiobutton3.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if (combobox1.text='M') and (radiobutton3.checked)then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
edit4.Text:=floattostr(strtofloatdef(edit3.text,0)*(strtofloatdef(edit2.Text,0)));
if(strtofloatdef(edit4.Text,0)>200000) then
begin
edit5.text:=floattostr(strtofloatdef(edit4.Text,0)*0.05);
edit6.text:=floattostr((strtofloatdef(edit4.Text,0)-strtofloatdef(edit5.Text,0)));
end
else
edit5.text:='0';
edit6.text:=floattostr((strtofloatdef(edit4.text,0)-strtofloatdef(edit5.text,0)));
if(strtofloatdef(edit2.text,0)<0) then
begin
edit4.Text:='INPUT SALAH';
edit5.Text:='0';
edit6.Text:='INPUT SALAH';
end;
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
if (combobox1.text='D') and (radiobutton1.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if (combobox1.text='S') and (radiobutton1.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if (combobox1.text='M') and (radiobutton1.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if (combobox1.text='D') and (radiobutton2.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if (combobox1.text='S') and (radiobutton2.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if (combobox1.text='M') and (radiobutton2.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if (combobox1.text='D') and (radiobutton3.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if (combobox1.text='S')and (radiobutton3.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if (combobox1.text='M') and (radiobutton3.checked)then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
edit4.Text:=floattostr(strtofloatdef(edit3.text,0)*(strtofloatdef(edit2.Text,0)));
if(strtofloatdef(edit4.Text,0)>200000) then
begin
edit5.text:=floattostr(strtofloatdef(edit4.Text,0)*0.05);
edit6.text:=floattostr((strtofloatdef(edit4.Text,0)-strtofloatdef(edit5.Text,0)));
end
else
edit5.text:='0';
edit6.text:=floattostr((strtofloatdef(edit4.text,0)-strtofloatdef(edit5.text,0)));
if(strtofloatdef(edit2.text,0)<0) then
begin
edit4.Text:='INPUT SALAH';
edit5.Text:='0';
edit6.Text:='INPUT SALAH';
end;
end;
procedure TForm1.RadioButton3Click(Sender: TObject);
begin
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if combobox1.text='D' then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if combobox1.text='S' then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if combobox1.text='M' then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
if (combobox1.text='D') and (radiobutton1.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='20000';
end;
if (combobox1.text='S') and (radiobutton1.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='21000';
end;
if (combobox1.text='M') and (radiobutton1.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='22000';
end;
if (combobox1.text='D') and (radiobutton2.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='30000';
end;
if (combobox1.text='S') and (radiobutton2.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='31000';
end;
if (combobox1.text='M') and (radiobutton2.checked) then
begin
edit1.Text:='MILO';
edit3.Text:='32000';
end;
if (combobox1.text='D') and (radiobutton3.checked) then
begin
edit1.Text:='DENCAW';
edit3.Text:='40000';
end;
if (combobox1.text='S')and (radiobutton3.checked) then
begin
edit1.Text:='SUSTAGEN';
edit3.Text:='41000';
end;
if (combobox1.text='M') and (radiobutton3.checked)then
begin
edit1.Text:='MILO';
edit3.Text:='42000';
end;
edit4.Text:=floattostr(strtofloatdef(edit3.text,0)*(strtofloatdef(edit2.Text,0)));
if(strtofloatdef(edit4.Text,0)>200000) then
begin
edit5.text:=floattostr(strtofloatdef(edit4.Text,0)*0.05);
edit6.text:=floattostr((strtofloatdef(edit4.Text,0)-strtofloatdef(edit5.Text,0)));
end
else
edit5.text:='0';
edit6.text:=floattostr((strtofloatdef(edit4.text,0)-strtofloatdef(edit5.text,0)));
if(strtofloatdef(edit2.text,0)<0) then
begin
edit4.Text:='INPUT SALAH';
edit5.Text:='0';
edit6.Text:='INPUT SALAH';
end;
Selamat mencoba codingnya ya..... Jika coding yang anda buat error, jangan lupa comment dibawah ya guyss.....
Semoga nggak error ya😆😆😆😆😆😆😆
Tidak ada komentar:
Posting Komentar