
Добавил:
Upload
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Grids;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
SG: TStringGrid;
Label2: TLabel;
SG2: TStringGrid;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
var
Truncated_Cone:TCone;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
r1,r2,l,h:real;
begin
l:=strtofloat(SG.Cells[1,0]);
h:=strtofloat(SG.Cells[1,1]);
r1:=strtofloat(SG.Cells[1,2]);
r2:=strtofloat(SG.Cells[1,3]);
Truncated_Cone:=TCone.Set_init(r1,r2,l,h);
Truncated_Cone.Free;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Label1.Caption:='Введите значения';
Form1.Label2.Caption:='';
SG.Cells[0,0]:='Образующая';
SG.Cells[0,1]:='Высота';
SG.Cells[0,2]:='Радиус малого основания';
SG.Cells[0,3]:='Радиус большого основания';
SG.Cells[1,0]:='0';
SG.Cells[1,1]:='0';
SG.Cells[1,2]:='0';
SG.Cells[1,3]:='0';
SG2.Cells[0,0]:='Площадь малого основания:';
SG2.Cells[0,1]:='Площадь большего основания:';
SG2.Cells[0,2]:='Площадь боковой поверхности:';
SG2.Cells[0,3]:='Полная площадь:';
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Grids;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
SG: TStringGrid;
Label2: TLabel;
SG2: TStringGrid;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
var
Truncated_Cone:TCone;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
r1,r2,l,h:real;
begin
l:=strtofloat(SG.Cells[1,0]);
h:=strtofloat(SG.Cells[1,1]);
r1:=strtofloat(SG.Cells[1,2]);
r2:=strtofloat(SG.Cells[1,3]);
Truncated_Cone:=TCone.Set_init(r1,r2,l,h);
Truncated_Cone.Free;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Label1.Caption:='Введите значения';
Form1.Label2.Caption:='';
SG.Cells[0,0]:='Образующая';
SG.Cells[0,1]:='Высота';
SG.Cells[0,2]:='Радиус малого основания';
SG.Cells[0,3]:='Радиус большого основания';
SG.Cells[1,0]:='0';
SG.Cells[1,1]:='0';
SG.Cells[1,2]:='0';
SG.Cells[1,3]:='0';
SG2.Cells[0,0]:='Площадь малого основания:';
SG2.Cells[0,1]:='Площадь большего основания:';
SG2.Cells[0,2]:='Площадь боковой поверхности:';
SG2.Cells[0,3]:='Полная площадь:';
end;
end.
Соседние файлы в папке 2