unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    Memo1: TMemo;
    Edit1: TEdit;
    procedure CheckBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.CheckBox1Click(Sender: TObject);
var sum: word;
      s: string;
begin
  sum:=0;
            memo1.Clear;
            memo1.Lines.Add('Чек:');
  if CheckBox1.Checked=true then
  begin
    sum:=sum+220;
    memo1.Lines.Add('Виски - 220');
  end;

  if CheckBox2.Checked=true then
  begin
    sum:=sum+60;
    memo1.Lines.Add('Гороховый суп - 60');
  end;

  if CheckBox3.Checked=true then
  begin
    sum:=sum+29;
    memo1.Lines.Add('Какао - 29');
  end;

  edit1.Text:=IntToStr(sum);

  memo1.Lines.Add('_______________');
  s:='Итого: '+IntToStr(sum);
  memo1.Lines.Add(s);

end;

end.
