0% found this document useful (0 votes)
34 views3 pages

Var X, Y: Integer Area: Integer Begin X: Strtoint (Edit1.Text) Y: Strtoint (Edit2.Text) Area: X Y Showmessage ('Área ' + Inttostr (Area) ) End

The document defines procedures for calculating the area of a rectangle from user-entered width and height values, and calculating the average of 4 test scores entered by the user to determine if they are approved or failed. It includes declarations for variables, constants, objects and procedures to run the calculations and display results when buttons are clicked.

Uploaded by

Graciane Musser
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views3 pages

Var X, Y: Integer Area: Integer Begin X: Strtoint (Edit1.Text) Y: Strtoint (Edit2.Text) Area: X Y Showmessage ('Área ' + Inttostr (Area) ) End

The document defines procedures for calculating the area of a rectangle from user-entered width and height values, and calculating the average of 4 test scores entered by the user to determine if they are approved or failed. It includes declarations for variables, constants, objects and procedures to run the calculations and display results when buttons are clicked.

Uploaded by

Graciane Musser
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

procedure TForm1. Button1Click(Sender: TObject); var X,Y: Integer; area: Integer; begin X := StrToInt(Edit1.Text); Y := StrToInt(Edit2.Text); area := X * Y; Label4.

Caption := IntToStr(area); end; procedure TForm1.Button1Click(Sender: TObject);


var X,Y: Integer; Area: Integer; begin X := StrToInt(Edit1.Text); Y := StrToInt(Edit2.Text); Area:= X * Y; ShowMessage('rea= ' + IntToStr(Area)); end;

unit Unit1; interface

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; Label5: TLabel; Button1: TButton; Button2: TButton; procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button2Click(Sender: TObject); begin Edit1.Text := ' '; Edit2.Text := ' '; Edit3.Text := ' '; Edit4.Text := ' '; Edit5.Text := ' '; end; procedure TForm1.Button1Click(Sender: TObject); Var b1, b2, b3, b4, media: real; begin b1:=StrToFloat(edit1.Text); b2:=StrToFloat(edit2.Text); b3:=StrToFloat(edit3.Text); b4:=StrToFloat(edit4.Text); media:=(b1+b2+b3+b4)/4; if media>=6 then Edit5.Text:=FloatToStr(media)+' - Aprovado' else

Edit5.Text:=FloatToStr(media)+' - Reprovado' end; end.

You might also like