Answer the question
In order to leave comments, you need to log in
How to write a Pascal program that inputs the coordinates of a point (x, y) and determines if the point falls within the shaded area?
A picture of the graph of the function is attached, only the circle and the square should be the other way around (2nd quarter-steep, 4th quarter-square).
Input: point coordinates (x, y).
Conclusion: belongs (does not belong).
Answer the question
In order to leave comments, you need to log in
If the boundaries are not included, then the procedure will look something like this:
procedure proc (real: x,y);
begin
if (x < 1) and (x > 0) then
if y > -1 and y < 0 then
writeln('true');
else writeln('false');
else if sqrt(x*x + y*y) < 1 then
if (x < 0) and (x > -1) then
if (y > 0) and (y < -1) then
writeln('true');
else writeln('false');
else writeln('false');
else writeln('false');
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question