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)
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- Edit1: TEdit;
- Edit2: TEdit;
- Edit3: TEdit;
- Edit4: TEdit;
- Edit5: TEdit;
- Edit6: TEdit;
- Edit7: TEdit;
- Edit8: TEdit;
- Button1: TButton;
- Button2: TButton;
- Button3: TButton;
- procedure FormCreate(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- procedure bersih; //inisialisasi pembuatan prosedur bersih
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.bersih; //awal pembuatan prosedur bersih
- begin
- Edit1.Clear;
- Edit2.Clear;
- Edit3.Clear;
- Edit4.Clear;
- Edit5.Clear;
- Edit6.Clear;
- Edit7.Clear;
- Edit8.Clear;
- end; //akhir pembuatan prosedur bersih
- procedure TForm1.Button1Click(Sender: TObject);
- var nt,nq,nm,nu,na:Real;
- begin
- if Edit1.Text='' then begin
- Application.MessageBox('Inputkan Nilainya Terlebih dahulu' +#13+'Good Luck Coy!!'+#13+'Di Halaman http://delphianimelover.blogspot.com','Heng !',MB_ICONWARNING);
- Edit1.SetFocus;
- Exit;
- end
- else if Edit2.Text='' then Begin
- Application.MessageBox('Inputkan Nilainya Terlebih dahulu' +#13+'Good Luck Coy!!'+#13+'Di Halaman http://delphianimelover.blogspot.com','Heng !',MB_ICONWARNING);
- Edit2.SetFocus;
- Exit;
- end
- else if Edit3.Text='' then Begin
- Application.MessageBox('Inputkan Nilainya Terlebih dahulu' +#13+'Good Luck Coy!!'+#13+'Di Halaman http://delphianimelover.blogspot.com','Heng !',MB_ICONWARNING);
- Edit3.SetFocus;
- Exit;
- end
- else if Edit4.Text='' then begin
- Application.MessageBox('Inputkan Nilainya Terlebih dahulu' +#13+'Good Luck Coy!!'+#13+'Di Halaman http://delphianimelover.blogspot.com','Heng !',MB_ICONWARNING);
- Edit4.SetFocus;
- Exit;
- end;
- nt:=StrtoFloat(Edit1.Text);
- nq:=StrtoFloat(Edit2.Text);
- nm:=StrtoFloat(Edit3.Text);
- nu:=StrtoFloat(Edit4.Text);
- na:=(nt*0.1) + (nq*0.1) + (nm*0.4) + (nu*0.4);
- Edit5.Text:=FloatToStr(na);
- if (Edit5.Text<='100') and (Edit5.Text>='81') then begin
- Edit6.Text:='A';
- Edit7.Text:='4';
- Edit8.Text:='Excelent';
- end
- else if (Edit5.Text<='80') and (Edit5.Text>='66') then begin
- Edit6.Text:='B';
- Edit7.Text:='3';
- Edit8.Text:='Baik';
- end
- else if (Edit5.Text<='65') and (Edit5.Text>='56') then begin
- Edit6.Text:='C';
- Edit7.Text:='2';
- Edit8.Text:='Cukup';
- end
- else if (Edit5.Text<='55') and (Edit5.Text>='41') then begin
- Edit6.Text:='D';
- Edit7.Text:='1';
- Edit8.Text:='Kurang';
- end
- else if (Edit5.Text<='10') and (Edit5.Text>='0') then begin
- Edit6.Text:='E';
- Edit7.Text:='0';
- Edit8.Text:='Gagal';
- end;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- Bersih; //prosedur bersih dipanggil
- end;
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- Self.Close;
- end;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- bersih;
- Label1.Caption:='Nilai Tugas';
- Label2.Caption:='Nilai Quiz';
- Label3.Caption:='Nilai MID';
- Label4.Caption:='Nilai UAS';
- Label5.Caption:='Nilai Angka';
- Label6.Caption:='Nilai Huruf';
- Label7.Caption:='Nilai Mutu';
- Label8.Caption:='Nilai Keterangan';
- Button1.Caption:='Hitung';
- Button2.Caption:='Clear';
- Button3.Caption:='Exit';
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement