Программирование.
Контрольна работа
Public declarations }. Задани № 3. X, t1, t2: smallint; If cut=text2 then. X, y, z: extended; If x>0 then begin. Label start, fin; Day: shortstring; Readln (text2); Readln (text1); Implementation. Implementation. Implementation. Implementation. Goto vano;end; Form1: TForm1; Form1: TForm1; Form1: TForm1; Form1: TForm1; Znachenie «); Readln (day); Goto fin;end; Goto fin;end; X: longint; Unit Unit1… Читать ещё >
Программирование. Контрольна работа (реферат, курсовая, диплом, контрольная)
Контрольная работа.
Складіть програму, визначальну чи є введені з клавіатури ціла кількість.
позитивним чи отрицательным.
Текст программы:
unit Unit1;
interface.
uses.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type.
TForm1 = class (TForm).
private.
public.
end;
var.
Form1: TForm1;
x: longint;
implementation.
label start, fin;
begin.
start:
write («Vvedite celoe chislo = «);
readln (x);
if x>0 then begin.
writeln («Dannoe chislo >0 »);goto fin; end;
if x.
writeln («Dannoe chislo.
if x=0 then writeln («Dannoe chislo =0 »);
fin:end.
Завдання № 2.
Напишіть програму, яка затребувана день тижня і, якщо введённый день.
є суботою чи неділею, видає повідомлення: «Сьогодні вихідний! «.
Текст программы:
unit Unit1;
interface.
uses.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type.
TForm1 = class (TForm).
private.
public.
end;
var.
day: shortstring;
Form1: TForm1;
implementation.
begin.
write («Vvedite den nedeli: »);
readln (day);
if day= «Monday «then write («Go to work »);
if day= «Tuesday «then write («Go to work »);
if day= «Wednesday «then write («Go to work »);
if day= «Thursday «then write («Go to work »);
if day= «Friday «then write («Go to work »);
if day= «Saturday «then write («Have some fun »);
if day= «Sunday «then write («Have some fun ») else Writeln («Vvedeno nepravilnoe.
znachenie ");
end.
Задани № 3.
Обчислите значення функції Z (x, y) при x=15,32 245; y=5,32 411 з максимальною.
точністю. Вигляд функції Z (x, y) відповідає завданням 1 до Лабораторної роботі № 1.
(по вариантам).
Текст программы:
unit Unit1;
interface.
uses.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type.
TForm1 = class (TForm).
private.
{ Private declarations }.
public.
{ Public declarations }.
end;
var.
Form1: TForm1;
x, y, z: extended;
implementation.
{$R *.DFM}.
label vano;
begin.
x:=15.32 245;y:=5.32 411;
vano:
if 2*x*x-4*y*y*y=0 then.
begin.
writeln («Pri dannix znacheniax X і Y funkcia ne imeet reshenia »);
goto vano;end;
z:=(cos (x)*(1-sin (y)))/(2*x*x-4*y*y*y);
write («Otvet: », z);
end.
Завдання № 4.
Складіть програму, яка затребувана два рядки тексту яких і визначає включає.
чи перший рядок текст введённый на другу строку.
Текст программы:
unit Unit1;
interface.
uses.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type.
TForm1 = class (TForm).
private.
public.
end;
var.
cut, text1, text2:shortstring;
x, t1, t2: smallint;
Form1: TForm1;
implementation.
label fin;
begin.
write («Vvedite 1-u stroku texta: »);
readln (text1);
write («Vvedite 2-u stroku texta: »);
readln (text2);
t1:=length (text1);t2:=length (text2);
if t1.
begin.
writeln («2 stroka > 1-oy, chto ne dopustimo »);
goto fin;end;
for x:=1 to t1-t2+1 do.
begin.
cut:=copy (text1,x, t2);
if cut=text2 then.
begin.
writeln («stroka 1 vkluchaet v sebia stroku 2 »);
goto fin;end;
end;
writeln («stroka 1 ne vkluchaet v sebia stroku 2 »);
fin:end.