y-axis (6, 4) (2, 2) (0,0) X-axis

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter7: Input/output Technology
Section: Chapter Questions
Problem 18VE
icon
Related questions
Question

Write a program that prompts the user to enter a
point (x, y) and checks whether the point is within the rectangle centred at (1, 1)
with width 10 and height 5. For example, (2, 2) is inside the rectangle and (6, 4)
is outside the rectangle, as shown in Figure . (Hint: A point is in the rectangle
if its horizontal distance to (0, 0) is less than or equal to 10 / 2 and its vertical
distance to (0, 0) is less than or equal to 5.0 / 2. Test your program to cover all
cases.) Here are two sample runs.

Enter a point with two coordinates: 2 2 ↵Enter
Point (2.0, 2.0) is in the rectangle

y-axis
(6, 4)
(2, 2)
(0,0)
X-axis
Transcribed Image Text:y-axis (6, 4) (2, 2) (0,0) X-axis
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning