Minggu, 21 Juni 2015

PROGRAM APLIKASI INPUT NILAI

PROGRAM APLIKASI INPUT NILAI

  • FORM
                    Adapun gambar dari form program aplikasinya seperti di bawah ini :

  • SCRIPT CODE (LISTING PROGRAM)
                   Adapun Script (listing program aplikasinya) dapat dilihat di bawah ini :
 unit UTS;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    GroupBox1: TGroupBox;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Image1: TImage;
    Button4: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  nim,nama,grade:string;
  TUGAS,MID,NUTS,UAS:real;
  NA:real;
implementation

uses hasil_nilai, Menu, Tentang;
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.show;
  Form2.Edit2.Text:=Edit2.Text;
  nim:=Edit1.Text;
  if nim='111' then
  Edit2.Text:='Himayatul Millah' else
  if nim='112' then
  Edit2.Text:='Qonita Syarif' else
  if nim='113' then
  Edit2.Text:='Maisirotul Riska' else
  Edit2.Text:='NIM tidak terdaftar';
  TUGAS:=StrToFloat(Edit3.Text);
  MID:=StrToFloat(Edit4.Text);
  NUTS:=StrToFloat(Edit5.Text);
  UAS:=StrToFloat(Edit6.Text);
  Form2.show;
  Form2.Edit3.Text:=FloatToStr(NA);
  TUGAS:=StrToFloat(Edit3.Text)*0.1;
  MID:=StrToFloat(Edit4.Text)*0.2;
  NUTS:=StrToFloat(Edit5.Text)*0.3;
  UAS:=StrToFloat(Edit6.Text)*0.4;
  NA:=TUGAS+MID+NUTS+UAS;
  Form2.Edit3.Text:=FloatToStr(NA);

  if (NA>=80) then Form2.Edit4.Text:='Sangat Baik' else
  if (NA>=65) and (NA<80) then Form2.Edit4.Text:='Baik' else
  if (NA>=55) and (NA<65) then Form2.Edit4.Text:='Sedang' else
  if (NA>=45) and (NA<55) then Form2.Edit4.Text:='Kurang' else
  Form2.Edit4.Text:='Sangat Kurang'
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Edit1.Text:='';
  Edit2.Text:='';
  Edit3.Text:='';
  Edit4.Text:='';
  Edit5.Text:='';
  Edit6.Text:='';
  Edit1.setfocus
end;

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

procedure TForm1.Button4Click(Sender: TObject);
begin
  Form4.show;
end;

end.
 
  • FORM RUNNING PROGRAM 
                   Adapun gambar dari form running program aplikasinya seperti di bawah ini :   

0 komentar:

Posting Komentar