Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

ООП / 2 / Unit1

.pas
Скачиваний:
46
Добавлен:
01.06.2015
Размер:
1 Кб
Скачать
☆
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.

Соседние файлы в папке 2
  • #
    01.06.20152 Кб46Unit1.~dfm
  • #
    01.06.20152 Кб46Unit1.~pas
  • #
    01.06.20155 Кб46Unit1.dcu
  • #
    01.06.201551 б46Unit1.ddp
  • #
    01.06.20152 Кб46Unit1.dfm
  • #
    01.06.20151 Кб46Unit1.pas
  • #
    01.06.20151 Кб47Unit2.~pas
  • #
    01.06.20153 Кб47Unit2.dcu
  • #
    01.06.20151 Кб47Unit2.pas