Контрольная работа
Составьте программу, определяющую является ли вводимое с клавиатуры целое число
положительным или отрицательным.
Текст программы:
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<0 then begin
writeln('Dannoe chislo <0');goto fin; end;
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,32245; y=5,32411 с максимальной
точностью.