Pengen share jawaban tugas mata kuliah bahasa pemrograman II (delphi)
tak usah panjang lebar, yang ingin copas, silahkan saja.
Jangan lupa komentarnya ya.....
Script Coding nya :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls;
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure
Button2Click(Sender: TObject);
private
{
Private declarations }
public
{
Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button3Click(Sender:
TObject);
begin
close
end;
procedure TForm1.Button1Click(Sender:
TObject);
var a,b,c : real;
begin
a:=integer(edit3.Text);
c:=strtofloat(edit1.text);
if (c<=20) then (edit2.Text:='E') else
if (c<=40) then (edit2.Text:='D') else
if (c<=60) then (edit2.Text:='C') else
if (c<=80) then (edit2.Text:='B') else
(edit2.Text:='A');
if (c<=20) then (edit3.Text:='Sangat
Kurang') else
if (c<=40) then (edit3.Text:='Kurang')else
if (c<=60) then (edit3.Text:='Cukup')else
if (c<=80) then (edit3.Text:='Baik') else
(edit3.Text:='Memuaskan')
end;
procedure TForm1.Button2Click(Sender:
TObject);
begin
edit1.clear;
edit2.clear;
edit3.clear;
edit1.setfocus;
end;
sekian jawaban tugas kali ini, semoga bermanfaat untuk temen-temen seperjuangan khususnya, dan bagi yang membutuhkan pada umumnya.
Wassalam...