Answered step by step
Verified Expert Solution
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
Geometry Part
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 and 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 coordinate for the lower left corner of the rectangle:
Enter the coordinate for the lower left corner of the rectangle:
Enter the width of the rectangle:
Enter the height of the rectangle:
Enter the coordinate of the point:
Enter the coordinate of the point:
On the rectangle
The first tests are worth points each. They test for the point being in the rectangle, on the rectangle, and outside the rectangle. The next tests are worth 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 points, tests for correct white space and capitalization, but the other tests do not.
LAB
ACTNIT
: Geometry Part
main.py
xLLstrinputC Enter the coordinate for the lower left corner of the rectangle:
I keep getting the output Outside the rectangle no matter the input
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started