Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > IT форум > Помощь студентам
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 27.05.2020, 11:25   #1
sh4i2h
Новичок
Джуниор
 
Регистрация: 27.05.2020
Сообщений: 1
По умолчанию Контейнер на адресной реализации

Ребят, привет!
Срочно нужна помощь, программа запускается с ошибками, что только не делал, код уже убитый полностью.
unit1
Код:
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Unit2;

type
TFilmi=class
private
FirstSeans:TFilmi;
Film:string;
public
constructor Create(aName:string);
function GetFirstSeans:TFilmi;
procedure AddSeans(anomSeans:string);
function DelSeans:boolean;
function FindSeans(anomSeans:string):TFilmi;
function GetAllSeansInf:string;
end;
implementation
procedure TFilmi.AddSeans(anomSeans:string);
begin
  FirstSeans:=TFilmi.Create(anomSeans,FirstSeans);
  end;
function TFilmi.DelSeans:boolean;
begin
  FirstSeans:=FirstSeans.GetNext;
  end;
function TFilmi.FindSeans(anomSeans:string):TSeans;
var CurrentAuto:TSeans;
  begin
    result:=nil;
    CurrentSeans:=FirstSeans;
    while (CurrentSeans<>nil) do
if (CurrentSeans.GetSeans=aSeans) then
begin result:=CurrentSeans; break; end
    else CurrentSeans:=CurrentSeans.GetNext;
    end;
unit2
Код:
unit Unit2;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils;

type TSeans=class
private
nextSeans:TSeans; //
nomSeans:string;
Stoimost:array[1..8] of integer;
Price:integer;
public
constructor Create(anomSeans:string);
function GetnomSeans:string;
function GetPrice:integer;
function GetStoimost(nom:integer):integer;
function SetStoimost(nom, newPrice: integer):boolean;
function AddStoimost(newPrice:integer):boolean;
function SumPrice: real;
function GetData:string;
end;


implementation
constructor TSeans.Create(anomSeans:string);
begin
  if anomSeans<>''  then
  nomSeans:=anomSeans; Price:=0;
  end;
function TSeans.GetPrice:integer;
begin result:=Price; end;
Function TSeans.GetnomSeans:string;
begin result:=nomSeans;
end;
function TSeans.GetStoimost(nom:integer):integer;
begin
  if (nom>1) and (nom<Price) then
  begin
    if nom in [1..8] then
    result:=Stoimost[nom];
  end;
end;

function TSeans.SetStoimost(nom, newPrice: integer):boolean;
begin
    if (nom>0) and (nom<=Price) and (newPrice in [0..50]) then
    Stoimost[nom]:=newPrice  ;
  end;
function TSeans.AddStoimost(newPrice:integer):boolean;
begin
    if (Price<7) and (newPrice in [0..50]) then
    begin
      Price:=Price+1;
      Stoimost[Price]:=newPrice;
        result:=true;
  end
    else
    result:=false;
    end;
function TSeans.SumPrice:real;
var
  SumPrica,i:integer;
begin
   SumPrice:=0;
   for i:=1 to Price do
   begin
   SumPrice:=SumPrice+Stoimost[i];
   end;
   result:=SumPrice
  end;
function TSeans.GetData:string;
  var
    i:integer;
begin
  result:=nomSeans;
  for i:=1 to Price do result:=result+' '+IntToStr(Stoimost[i]);
  result:=result+' Сумма='+FloatToStr(SumPrice);
  end;
end.
https://prnt.sc/solyyb
sh4i2h вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
канкатинация адресной строки serrgggeee JavaScript, Ajax 8 28.01.2014 12:48
Формирование адресной строки php serrgggeee PHP 0 27.12.2013 02:07
вопрос по адресной арифметике Dimanw92 Общие вопросы C/C++ 4 21.05.2012 21:58
Текст в адресной строке welcomeTo PHP 8 25.12.2010 09:28
Индикаторы в адресной строке Phantom JavaScript, Ajax 4 02.03.2010 12:13