unit UProgramNilai;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
Tfrmprogramnilai = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
edtnim: TEdit;
Shape1: TShape;
edtnama: TEdit;
cbokelas: TComboBox;
cbomatakuliah: TComboBox;
Shape2: TShape;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;a
Label8: TLabel;
Label9: TLabel;
edtnilaiabsen: TEdit;
edtnilaitugas: TEdit;
edtnilaikuis: TEdit;
edtnilaiuts: TEdit;
edtnilaiuas: TEdit;
Label10: TLabel;
Shape3: TShape;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
edtnilaiakhir: TEdit;
edtnilaihuruf: TEdit;
edtpredikat: TEdit;
edtketerangan: TEdit;
Shape4: TShape;
Shape5: TShape;
new: TBitBtn;
proses: TBitBtn;
exit: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure exitClick(Sender: TObject);
procedure newClick(Sender: TObject);
procedure prosesClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmprogramnilai: Tfrmprogramnilai;
implementation
{$R *.dfm}
procedure Tfrmprogramnilai.FormCreate(Sender: TObject);
begin
cbokelas.Items.Add('mik 10-01');
cbokelas.Items.Add('mik 10-02');
cbokelas.Items.Add('mik 10-03');
cbokelas.Items.Add('mik 10-04');
cbokelas.Items.Add('mik 10-05');
cbokelas.Items.Add('mik 10-06');
cbokelas.Items.Add('mik 10-07');
cbokelas.Items.Add('mik 10-08');
cbokelas.Items.Add('mik 10-09');
cbokelas.Items.Add('mik 10-10');
cbokelas.Items.Add('mik 10-11');
cbokelas.Items.Add('mik 10-12');
cbokelas.Items.Add('mik 10-13');
cbokelas.Items.Add('mik 10-14');
cbokelas.Items.Add('mik 10-15');
cbokelas.Items.Add('mik 10-16');
cbokelas.Items.Add('mik 10-17');
cbokelas.Items.Add('mik 10-18');
cbokelas.Items.Add('mik 10-18');
cbokelas.Items.Add('mik 10-19');
cbokelas.Items.Add('mik 10-20');
cbokelas.Items.Add('mik 10-21');
cbokelas.Items.Add('mik 10-22');
end;
procedure Tfrmprogramnilai.exitClick(Sender: TObject);
begin
close;
end;
procedure Tfrmprogramnilai.newClick(Sender: TObject);
begin
edtnim.Text:=' ';
edtnama.Text:=' ';
cbokelas.Text:=' ';
cbomatakuliah.Text:='0 ';
edtnilaiabsen.Text:='0 ';
edtnilaitugas.Text:='0';
edtnilaikuis.Text:='0';
edtnilaiuts.Text:='0';
edtnilaiuas.Text:='0';
edtnilaiakhir.Text:='0';
edtnilaihuruf.Text:='0';
edtpredikat.Text:='0';
edtketerangan.Text:='0';
end;
procedure Tfrmprogramnilai.prosesClick(Sender: TObject);
var
A,B,C,D,E:Integer;
f:Real;
g,h,i,j:String;
begin
a:=strtoint(edtnilaiabsen.Text);
b:=StrToInt(edtnilaitugas.Text);
c:=StrToInt(edtnilaikuis.Text);
d:=StrToInt(edtnilaiuts.Text);
e:=StrToInt(edtnilaiuas.Text);
f:=0.1*a+0.2*b+0.1*c+0.25*d+0.25*e;
if(f>=80and(f<=100)then begin g:='A'; h:='sangat memuaskan'; i:='lulus'; end; else if(f>=70 and (f<=79)then begin g:='b'; h:='memuaskan'; i:='lulus'; end; else if(f>=60 and (f<=69)then begin g:='c'; h:='cukup memuaskan'; i:='lulus'; end; else if(f>=50 and (f<=59)then begin g:='d'; h:='kurang memuaskan'; i:='gagal'; end; else if(f>=80 and (f<=100)then begin g:='e'; h:='sangat kurang memuaskan'; i:='gagal'; end; edtnilaiakhir.Text:=floattostr(f); edtnilaihuruf.Text:=g; edtpredikat.Text:=h; edtketerangan.Text:=i; if (a=0)or(b=0)or(c=0)or(d=0)or(e=0) then j:='anda harus mengikuti UPN' else if (a<>0)or(b<>0)or(c<>0)or(d<>0)or(e<>0)
then j:='anda harus mengikuti HER'
mpesan.text:=j;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
Tfrmprogramnilai = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
edtnim: TEdit;
Shape1: TShape;
edtnama: TEdit;
cbokelas: TComboBox;
cbomatakuliah: TComboBox;
Shape2: TShape;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;a
Label8: TLabel;
Label9: TLabel;
edtnilaiabsen: TEdit;
edtnilaitugas: TEdit;
edtnilaikuis: TEdit;
edtnilaiuts: TEdit;
edtnilaiuas: TEdit;
Label10: TLabel;
Shape3: TShape;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
edtnilaiakhir: TEdit;
edtnilaihuruf: TEdit;
edtpredikat: TEdit;
edtketerangan: TEdit;
Shape4: TShape;
Shape5: TShape;
new: TBitBtn;
proses: TBitBtn;
exit: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure exitClick(Sender: TObject);
procedure newClick(Sender: TObject);
procedure prosesClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmprogramnilai: Tfrmprogramnilai;
implementation
{$R *.dfm}
procedure Tfrmprogramnilai.FormCreate(Sender: TObject);
begin
cbokelas.Items.Add('mik 10-01');
cbokelas.Items.Add('mik 10-02');
cbokelas.Items.Add('mik 10-03');
cbokelas.Items.Add('mik 10-04');
cbokelas.Items.Add('mik 10-05');
cbokelas.Items.Add('mik 10-06');
cbokelas.Items.Add('mik 10-07');
cbokelas.Items.Add('mik 10-08');
cbokelas.Items.Add('mik 10-09');
cbokelas.Items.Add('mik 10-10');
cbokelas.Items.Add('mik 10-11');
cbokelas.Items.Add('mik 10-12');
cbokelas.Items.Add('mik 10-13');
cbokelas.Items.Add('mik 10-14');
cbokelas.Items.Add('mik 10-15');
cbokelas.Items.Add('mik 10-16');
cbokelas.Items.Add('mik 10-17');
cbokelas.Items.Add('mik 10-18');
cbokelas.Items.Add('mik 10-18');
cbokelas.Items.Add('mik 10-19');
cbokelas.Items.Add('mik 10-20');
cbokelas.Items.Add('mik 10-21');
cbokelas.Items.Add('mik 10-22');
end;
procedure Tfrmprogramnilai.exitClick(Sender: TObject);
begin
close;
end;
procedure Tfrmprogramnilai.newClick(Sender: TObject);
begin
edtnim.Text:=' ';
edtnama.Text:=' ';
cbokelas.Text:=' ';
cbomatakuliah.Text:='0 ';
edtnilaiabsen.Text:='0 ';
edtnilaitugas.Text:='0';
edtnilaikuis.Text:='0';
edtnilaiuts.Text:='0';
edtnilaiuas.Text:='0';
edtnilaiakhir.Text:='0';
edtnilaihuruf.Text:='0';
edtpredikat.Text:='0';
edtketerangan.Text:='0';
end;
procedure Tfrmprogramnilai.prosesClick(Sender: TObject);
var
A,B,C,D,E:Integer;
f:Real;
g,h,i,j:String;
begin
a:=strtoint(edtnilaiabsen.Text);
b:=StrToInt(edtnilaitugas.Text);
c:=StrToInt(edtnilaikuis.Text);
d:=StrToInt(edtnilaiuts.Text);
e:=StrToInt(edtnilaiuas.Text);
f:=0.1*a+0.2*b+0.1*c+0.25*d+0.25*e;
if(f>=80and(f<=100)then begin g:='A'; h:='sangat memuaskan'; i:='lulus'; end; else if(f>=70 and (f<=79)then begin g:='b'; h:='memuaskan'; i:='lulus'; end; else if(f>=60 and (f<=69)then begin g:='c'; h:='cukup memuaskan'; i:='lulus'; end; else if(f>=50 and (f<=59)then begin g:='d'; h:='kurang memuaskan'; i:='gagal'; end; else if(f>=80 and (f<=100)then begin g:='e'; h:='sangat kurang memuaskan'; i:='gagal'; end; edtnilaiakhir.Text:=floattostr(f); edtnilaihuruf.Text:=g; edtpredikat.Text:=h; edtketerangan.Text:=i; if (a=0)or(b=0)or(c=0)or(d=0)or(e=0) then j:='anda harus mengikuti UPN' else if (a<>0)or(b<>0)or(c<>0)or(d<>0)or(e<>0)
then j:='anda harus mengikuti HER'
mpesan.text:=j;
end;
end.