Selasa, 26 Juni 2012

Input Nilai Rapor

Project aplikasi Input Nilai Rapor Menggunakan Delphi 7

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, XPMan;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label12: TLabel;
    Label18: TLabel;
    Shape2: TShape;
    edit1: TEdit;
    edit2: TEdit;
    edit3: TEdit;
    edit4: TEdit;
    edit5: TEdit;
    edit6: TEdit;
    edit7: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    ComboBox1: TComboBox;
    Timer1: TTimer;
    Label13: TLabel;
    Panel1: TPanel;
    Label11: TLabel;
    XPManifest1: TXPManifest;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
tugas, quiz, hadir, uts, uas : real;
hasil : real;
nilai : string;
begin
tugas:=(((strtofloat(edit1.Text)+strtofloat(edit2.Text)+strtofloat(edit3.Text))/3)*0.1);
quiz:=(((strtofloat(edit4.Text)+strtofloat(edit5.Text))/2)*0.1);
hadir:=(((strtofloat(ComboBox1.Text))/14)*10);
uts:=((strtofloat(edit6.Text))*0.3);
uas:=((strtofloat(edit7.Text))*0.4);
hasil:=(tugas+quiz+hadir+uts+uas);
str(hasil:0:2,nilai);
label12.caption:=(nilai);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
edit4.Clear;
edit5.Clear;
ComboBox1.Clear;
edit6.Clear;
edit7.Clear;
Label12.Caption:='';
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Close;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
label11.Left :=  label11.Left - 5;
if  label11.Left <= -100 then
label11.Left := 550;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if MessageDlg('Apakah anda yakin untuk'+#13+'keluar dari program ini ?',
      mtConfirmation,[mbYes,mbNo],0)=mrNo then
    CanClose:=False;
end;

end.

Tidak ada komentar:

Posting Komentar

TERIMA KASIH ATAS KOMENTAR ANDA, MOHON UNTUK TIDAK BERKOMENTAR YANG BERNADA SPAM ATAU BERBAU PORNO.

Selamat Datang Di AcehDelphi Semoga Bermanfaat Bagi Anda | TERIMA KASIH atas kunjungan dan komentarnya.