Question: Write a program that prompts the user to enter: 1. height and width of rectangle (x.y) 2. enter a point (p1. p2) 3.call a function

Write a program that prompts the user to enter:
1. height and width of rectangle (x.y)
2. enter a point (p1. p2)
3.call a function Checks whether the point is within the rectangle centered at (0, 0)
1.
of
with width x and height y. For example. (2. 2) is inside the rectangle of 10 as width and 5 as the heightbut6, 4s outs
stion
this rectangle, as shown in the Figure.
Your program should readectangle width and height until user enter 0 width and 0 height
Y axis
(6,4)
(2. 2)
(Q.0)
Here are sample runs of the program:
Enter Height and Width of Rectangle
(0 width or 0 height ) to Stop: 10 5
Enter pint (x, y). Values to
check if it's inside rectangle : 22
Point (2.00, 2.00) 1s INSIDE the rectangle of (width, height)= ((10.00, 5.00)
=====
============
Enter Height and Width of Rectangle
(0width or 0 height to Stop: 10 5
Enter pint (x, y) Values co
check ti aiheide rectangle: 64
Posnt (6.00, 4.00) s OUTEIDE the rectenge or deh, height)((10.00, 5.00)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!