Question: Write a program that prompts the user to enter two values : x and y. The two values represent the coordinate of a point (x,y).

Write a program that prompts the user to enter two values : x and y. The two values represent the coordinate of a point (x,y). Then, check whether the point is inside or outside the rectangle centered at (0,0) with width 20 and height 10. For example, (2,2) is inside the rectangle but the point (6,7) is outside the rectangle. Points on the border are not considered inside the rectangle.

The printed result should only be "inside" or "outside"

input 1 :2, 2

output 1: inside

input 2 : 6,7

output 2 : outside

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!