Доделать код unit proect; {$mode objfpc}{$h+} interface uses classes, sysutils, fileutil, tagraph, taseries,forms, controls, graphics, dialogs, stdctrls, extctrls; type { tform1 } tform1 = class(tform) button1: tbutton; chart1: tchart; image5: timage; image6: timage; label14: tlabel; label15: tlabel; sinseries2: tlineseries; cosseries2: tlineseries; edit3: tedit; edit4: tedit; edit1: tedit; edit2: tedit; image1: timage; image2: timage; image3: timage; image4: timage; label1: tlabel; label10: tlabel; label11: tlabel; label12: tlabel; label13: tlabel; label2: tlabel; label3: tlabel; label4: tlabel; label5: tlabel; label6: tlabel; label7: tlabel; label8: tlabel; label9: tlabel; shape1: tshape; sinseries: tlineseries; cosseries: tlineseries; sincosseries: tlineseries; procedure button1click(sender: tobject); private { private declarations } public { public declarations } end; var form1: tform1; implementation {$r *.lfm} { tform1 } procedure tform1.button1click(sender: tobject); const n = 100; min = -5; max = 5; var x: double; a,b,c,d,i: integer; begin //чистка предыдущих графиков //считываем переменные с клавиатуры a: =strtoint(edit1.text); b: =strtoint(edit2.text); c: =strtoint(edit3.text); d: =strtoint(edit4.text); for i: =0 to n-1 do begin //задаем для графиков площадь x : = min + (max - min) * i /(n - 1); //рисуем графики sinseries.addxy(x, (a*x+b)); cosseries.addxy(x, (d*x*x)); sincosseries.addxy(x,(c/x)); sinseries2.addxy(x, sin(x)); cosseries2.addxy(x, cos(x)); end; end. ошибка: fatal: syntax error, "begin" expected but "end of file" found lazarus.

Арсенал11 Арсенал11    3   02.09.2019 17:50    0

Ответы
Latimel Latimel  06.10.2020 12:51
Unit proect;

{$mode objfpc}{$H+}

interface
uses
Classes, SysUtils, FileUtil, TAGraph, TASeries,Forms,
Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;

type
    
    { TForm1 }
    TForm1 = class(TForm)
        Button1: TButton;
        Chart1: TChart;
        Image5: TImage;
        Image6: TImage;
        Label14: TLabel;
        Label15: TLabel;
        SinSeries2: TLineSeries;
        CosSeries2: TLineSeries;
        Edit3: TEdit;
        Edit4: TEdit;
        Edit1: TEdit;
        Edit2: TEdit;
        Image1: TImage;
        Image2: TImage;
        Image3: TImage;
        Image4: TImage;
        Label1: TLabel;
        Label10: TLabel;
        Label11: TLabel;
        Label12: TLabel;
        Label13: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label4: TLabel;
        Label5: TLabel;
        Label6: TLabel;
        Label7: TLabel;
        Label8: TLabel;
        Label9: TLabel;
        Shape1: TShape;
        SinSeries: TLineSeries;
        CosSeries: TLineSeries;
        SinCosSeries: TLineSeries;
        procedure Button1Click(Sender: TObject);
    private
    { private declarations }
    public
    { public declarations }
    end;

var
    Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
const
    N = 100;
    MIN = -5;
    MAX = 5;
var
    x, step: Double;
    a, b, c, d, i: Integer;
begin
    //чистка предыдущих графиков
    //считываем переменные
    a := StrToInt(Edit1.Text);
    b := StrToInt(Edit2.Text);
    c := StrToInt(Edit3.Text);
    d := StrToInt(Edit4.Text);
    
    step := (MAX - MIN) / N;
    x := MIN;
    
    repeat
        //Рисуем графики
        SinSeries.AddXY(x, a * x + b);
        CosSeries.AddXY(x, d * x * x);
        SinCosSeries.AddXY(x, c / x);
        SinSeries2.AddXY(x, sin(x));
        CosSeries2.AddXY(x, cos(x));
        //следующий
        x := x + step;
    until x > MAX;
end;
end.
ПОКАЗАТЬ ОТВЕТЫ
Другие вопросы по теме Информатика