Senin, 26 Maret 2012

Listing Program Delphi Pertemuan 2

Output programnya:


Untuk listing program pertamuan kedua labTI:




unit Pertemuan2;

interface

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

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    Button2: TButton;
    GroupBox2: TGroupBox;
    Label3: TLabel;
    Label4: TLabel;
    Edit3: TEdit;
    Edit4: TEdit;
    Button3: TButton;
    Edit5: TEdit;
    GroupBox3: TGroupBox;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    GroupBox4: TGroupBox;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
A:string;
begin
  A:='Praktikum';
  if edit1.Text=A then
  showmessage('Praktikum')
end;

procedure TForm1.Button2Click(Sender: TObject);
var
nilai:integer;
begin
  if StrToInt (edit2.Text)<30 then
  showmessage ('Nilai E')
  else if StrToInt (edit2.Text)<=50 then
  showmessage ('Nilai D')
  else if StrToInt (edit2.Text)<=60 then
  showmessage ('Nilai C')
  else if StrToInt (edit2.Text)<=70 then
  showmessage ('Nilai B')
  else if StrToInt (edit2.Text)<=100 then
  showmessage ('Nilai A')
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  case StrToInt (edit3.Text) of
  1:edit5.Text:='Anda Pesan Bakso';
  2:edit5.Text:='Anda Pesan Mie Ayam';
  3:edit5.Text:='Anda Pesan Gado-gado';
end;
  case StrToInt (edit4.Text) of
  1:edit5.Text:=edit5.Text+' Minumnya Es Tawar';
  2:edit5.Text:=edit5.Text+' Minumnya Es Doger';
  3:edit5.Text:=edit5.Text+' Minumnya Cendol';
end;
end;
end.

0 komentar:

Posting Komentar

 
Iron Man Helmet