Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer in detail using CPP (C++) coding. please use a copy and paste format 2. Point in Rectangle A point in the Cartesian plane

Please answer in detail using CPP (C++) coding.

please use a copy and paste format

image text in transcribed

2. Point in Rectangle A point in the Cartesian plane can be represented by a its coordinate pair (x, y), whereas a rectangle can be represented by its 4 points. The diagram below illustrates a rectangle, represented by 4 blue points, and a red point (x, y), which could be anywhere on the plane. 9 8 (x4,44) (33,43) 7 6 2 (x,y) 5 4 3 2 (21, y1) (22,42) 1 0 1 2 3 4. 5 6 7 8 9 Your task is to write a program that takes in the coordinates of the rectangle, and the coordinates of the red point, and determines whether the point is inside the rectangle or not. If the point touches the edge of the rectangle. then it counts as inside. Think about what variables, and how many, you need to have in order to represent the rectangle and the point, and to be able to compute the correct answer. Your program for this exercise should be called point_in_rect.cpp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

7 Describe the role of an HR business partner

Answered: 1 week ago

Question

Are the rules readily available?

Answered: 1 week ago

Question

Are these written ground rules?

Answered: 1 week ago