Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ programming A rectangle is completely determined by the coordinates of two of its diagonally opposite corners. For example, the points (1, 2) and (7,

C++ programming

A rectangle is completely determined by the coordinates of two of its diagonally opposite corners. For example, the points (1, 2) and (7, 5) determine a rectangle whose left edge has equation x = 1, whose right edge has equation x = 7, whose bottom edge has equation y = 2 and whose top edge has equation y = 5. Any point whose x-coordinate is between 1 and 7 and whose y-coordinate is between 2 and 5 lies within this rectangle.

Write a program that determines whether or not a given point is contained in a given rectangle.

Your program should:

Prompt the user for the upper left corner of a rectangle.

Prompt the user for the lower right corner of the rectangle.

Prompt the user for the coordinates of a point.

Output whether or not the point is inside the rectangle.

Repeat the above steps until the user enters (0, 0) for both corners of the rectangle.

Assume that all coordinates are non-negative integers with (0, 0) being the extreme upper-right corner.

Be readable with appropriate documentation and formatting.

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

Students also viewed these Databases questions

Question

explain what is meant by the term fair dismissal

Answered: 1 week ago

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago