Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions