Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the design for determining if a point is inside, on, or outside of the rectangle. Drawing out the rectangle and labeling the coordinates of

image text in transcribed
Create the design for determining if a point is inside, on, or outside of the rectangle. Drawing out the rectangle and labeling the coordinates of all points will help you to visualize the problem. Once the design has been completed, write a program that prompts the user for the x and y coordinates for the lower left hand corner of a rectangle as well as the height and the width of the rectangle. After that, you will need to get the coordinates for the point from the user as well. Once all inputs have been entered by the user, determine if the point is inside the rectangle, on the rectangle, or outside the rectangle. if the point is inside the rectangle, print "inside the rectangle". If the point is on the rectangle, print 'On the rectangle". If the point is outside of the rectangle, print "Outside the rectangle". Sample Execution: Enter the x coordinate for the lower left corner of the rectangle: 1 Enter the y coordinate for the lower left torner of the rectanglet 1 Enter the width of the rectangle: 5 Enter the hedght of the rectangle: 3 Enter the x coordinate of the point: 2 Enter the y coordinate of the pointr 1 On the rectangle The first 3 tests are worth 20 points each. They test for the point being in the rectangle, on the rectangle, and outside the rectangle. The next 3 teits are worth 10 points each. They also test for a point being in the rectangle, on the rectangle, and outside the rectangle, but with different points for the rectangle and different coordinates for the point. The last test, worth 10 points, tests for correct white space and capitalization, but the other tests do not

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

Were they made on a timely basis?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago