0% found this document useful (0 votes)
8 views2 pages

Shpere Memo

Uploaded by

swiched123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Shpere Memo

Uploaded by

swiched123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

unit uSphereSurfaceAreaVolume;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, Math, Buttons, ExtCtrls;

type
TfrmSphere = class(TForm)
lblRadius: TLabel;
edtRadius: TEdit;
redDisplay: TRichEdit;
btnCalculate: TButton;
imgSphere: TImage;
bmbClose: TBitBtn;
procedure FormShow(Sender: TObject);
procedure btnCalculateClick(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
end;

var
frmSphere: TfrmSphere;

implementation

{$R *.dfm}

procedure TfrmSphere.btnCalculateClick(Sender: TObject);


var
rradius, rvolume, rsArea: real;
begin
rradius := strtofloat(edtRadius.text);

rsArea := (4 * 3.1415926535897932384626433832795 * (sqr(rradius)));


rvolume := (4 / 3 * 3.1415926535897932384626433832795 *
((rradius) * (rradius) * (rradius)));
redDisplay.lines.Add('Radius ' + #9 + #9 + floattostrf(rradius, fffixed, 8, 2
#13 + 'Surface Area ' + #9 + floattostrf(rsArea, fffixed, 8, 2) + #13 +
'Volume ' + #9 + #9 + floattostrf(rvolume, fffixed, 8, 2));
end;

procedure TfrmSphere.FormShow(Sender: TObject);


begin
imgSphere.Picture.LoadFromFile('Sphere.bmp');
frmSphere.brush.Color := clblack;
lblRadius.Font.Color := clwhite;
end;

end.

You might also like