Oke Teman-Teman, kali ini saya akan memposting bagaimana cara membuat aplikasi untuk menghitung nilai akhir dari setiap mata kuliah.... buat yang berminat untuk memcoba membuatnya silahkan aja di coba... di bawah ini merupakan desain form utama dari aplikasi ane...
jika di klik tombol kuis akan muncul form seperti ini ...
jika di klik tombol Tugas akan muncul form seperti ini ...
untuk coddingnya anda bisa Lihat di bawah ini ....
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, DBCtrls, Grids, DBGrids, DB, ADODB,
jpeg;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label5: TLabel;
Label6: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
GroupBox2: TGroupBox;
Edit7: TEdit;
Edit8: TEdit;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Edit9: TEdit;
Button1: TButton;
ADOconnection1: TADOConnection;
ADOTable1: TADOTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Button2: TButton;
Edit10: TEdit;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
Image1: TImage;
Label4: TLabel;
GroupBox3: TGroupBox;
Edit11: TEdit;
Label10: TLabel;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
procedure BitBtn6Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
Nama, NPM : string;
Kehadiran, tugas, kuis, uts, uas, nilai, grade : real;
end;
var
Form1: TForm1;
implementation
uses Unit2, Unit3;
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
var a,b,c,d,e : real ;
begin
Nama := edit1.Text;
NPM := edit2.Text;
Kehadiran := strtofloat (edit3.Text);
Kuis := strtofloat (edit4.Text);
Tugas := strtofloat (edit10.Text);
UTS := strtofloat (edit5.Text);
UAS := strtofloat (edit6.Text);
nilai := (kehadiran+tugas+kuis+uts+uas)/4;
edit7.Text := nama;
edit8.Text := NPM;
edit9.Text := floattostr (nilai);
if nilai >80 then
edit11.Text := ('A');
if nilai <80 then
edit11.Text := ('B');
if nilai <70 then
edit11.Text := ('C');
if nilai <60 then
edit11.Text := ('D');
if nilai <50 then
edit11.Text := ('E');
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
edit1.Text := ' ';
edit2.Text := ' ';
edit3.Text := ' ';
edit4.Text := ' ';
edit5.Text := ' ';
edit6.Text := ' ';
edit7.Text := ' ';
edit8.Text := ' ';
edit9.Text := ' ';
edit10.Text := ' ';
end;
procedure TForm1.BitBtn5Click(Sender: TObject);
begin
close;
end;
procedure TForm1.BitBtn6Click(Sender: TObject);
begin
AdoTable1.Open;
AdoTable1.Append;
ADOTable1.FieldByName('Nama') .AsString:= edit1.Text;
ADOTable1.FieldByName('NPM').AsString:= edit2.Text;
ADOTable1.FieldByName('Kehadiran') .AsString:= edit3.Text;
ADOTable1.FieldByName('Kuis') .AsString:= edit4.Text;
ADOTable1.FieldByName('Tugas') .AsString:= edit10.Text;
ADOTable1.FieldByName('UTS') .AsString:= edit5.Text;
ADOTable1.FieldByName('UAS') .AsString:= edit6.Text;
ADOTable1.FieldByName('Total Nilai') .AsString:= edit9.Text;
ADOTable1.FieldByName('Grade') .AsString:= edit11.Text;
ADOTable1.Post;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
form3.show;
end;
end.
Selamat Mencoba sobat .... good luck