unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Etulis: TEdit;
Epraktek: TEdit;
Label5: TLabel;
Label6: TLabel;
E40: TEdit;
E60: TEdit;
Label7: TLabel;
Enilai: TEdit;
Label8: TLabel;
Egrade: TEdit;
GroupBox1: TGroupBox;
Cmi: TCheckBox;
Ctk: TCheckBox;
Label9: TLabel;
Label10: TLabel;
Emi: TEdit;
Etk: TEdit;
GroupBox2: TGroupBox;
Rbpagi: TRadioButton;
Rbsore: TRadioButton;
Label11: TLabel;
Ewaktu: TEdit;
Btotal: TButton;
Etotal: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure EtulisExit(Sender: TObject);
procedure EtulisKeyPress(Sender: TObject; var Key: Char);
procedure EpraktekExit(Sender: TObject);
procedure EpraktekKeyPress(Sender: TObject; var Key: Char);
procedure CmiClick(Sender: TObject);
procedure CtkClick(Sender: TObject);
procedure RbpagiClick(Sender: TObject);
procedure RbsoreClick(Sender: TObject);
procedure BtotalClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
if (application.MessageBox('Are You sure To Exit','Information',MB_YESNO)=IDYES) then
close;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Etulis.Clear; Epraktek.Clear; E40.Clear; E60.Clear;
Enilai.Clear; Egrade.Clear; Emi.Clear; Etk.Clear;
Ewaktu.Clear; Etotal.Clear;
Cmi.Checked:=false;
ctk.Checked:=false;
Rbpagi.Checked:=false;
Rbsore.Checked:=false;
Etulis.SetFocus;
end;
procedure TForm1.EtulisExit(Sender: TObject);
begin
E40.Text:=floattostr(strtofloat(Etulis.Text)*0.4);
end;
procedure TForm1.EtulisKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
Epraktek.SetFocus;
end;
procedure TForm1.EpraktekExit(Sender: TObject);
begin
E60.Text:=floattostr(strtofloat(epraktek.Text)*0.6);
Enilai.Text:=floattostr(strtofloat(e60.Text)+strtofloat(e40.Text));
if enilai.Text > '60' then
Egrade.Text := 'LULUS'
else if enilai.Text < '60' then
Egrade.Text := 'Tidak Lulus';
end;
procedure TForm1.EpraktekKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
Cmi.SetFocus;
end;
procedure TForm1.CmiClick(Sender: TObject);
begin
if cmi.Checked then
Emi.Text := '250000'
else
Emi.Text:='0';
end;
procedure TForm1.CtkClick(Sender: TObject);
begin
if ctk.Checked then
etk.Text := '300000'
else
etk.Text:='0';
end;
procedure TForm1.RbpagiClick(Sender: TObject);
begin
if Rbpagi.Checked then
Ewaktu.Text := '5000'
end;
procedure TForm1.RbsoreClick(Sender: TObject);
begin
if Rbsore.Checked then
Ewaktu.Text := '10000';
end;
procedure TForm1.BtotalClick(Sender: TObject);
begin
Etotal.Text:=floattostr(strtofloat(emi.Text)+strtofloat(etk.Text)+strtofloat
(ewaktu.Text));
end;
end.
1 komentar:
kasi lengkap bosss, sekalian tugas yang satunya
Posting Komentar