Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 . 2 2 Geometry Part 2 Create the design for determining if a point is inside, on , or outside of the rectangle. Drawing

4.22 Geometry Part 2
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 comer 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 corner of the rectangle: 1
Enter the width of the rectangle:
5.
Enter the height of the rectangle:
3
Enter the x coordinate of the point:
2
Enter the y coordinate of the point:
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 tests 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.
LAB
ACTNIT
4.221: Geometry Part 2
30100
main.py
xLL=str(input[C Enter the x coordinate for the lower left corner of the rectangle: 2
I keep getting the output Outside the rectangle no matter the input
image text in transcribed

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

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

Students also viewed these Databases questions

Question

=+ a. a family deciding whether to buy a new car

Answered: 1 week ago

Question

=+10. How are inflation and unemployment related in the short run?

Answered: 1 week ago