Program Mengitung Nilai ujian (if majemuk) via delphi 2010 by riki darman
ni desainnya :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var uts:real;
uas:real;
angka:real;
huruf: string;
begin
uts:= StrToFloat(Edit1 .Text );
uas:= StrToFloat(Edit2 .Text ) ;
angka := (uts + uas) / 2;
If Angka <20 then
Huruf:='E'
else If Angka <30 then
Huruf:='D'
else If Angka <35 then
Huruf:='C-'
else If Angka <40 then
Huruf:='C'
else If Angka <50 then
Huruf:='C+'
else If Angka <60 then
Huruf:='B-'
else If Angka <70 then
Huruf:='B'
else If Angka <80 then
Huruf:='B+'
else If Angka <90 then
Huruf:='A-'
else
Huruf:='A';
edit3.Text := FloatToStr(angka ) ;
edit4.Text := huruf;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text :='';
edit2.Text :='';
edit3.Text :='';
edit4.Text :='';
end;
end.
0 Response to "Program Mengitung Nilai ujian (if majemuk) via delphi 2010 by riki darman"
Post a Comment