Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Students: Section 4 . 2 2 is a part of 1 assignment: Lab 2 : Geometry Pt 2 Includes: zyLab No due date 4 .
Students:
Section is a part of assignment: Lab : Geometry Pt
Includes: zyLab
No due date
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 de has been completed, write a program that prompts the user for the and coordinates for the lower left hand corner of a rectangle as ell 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 noints each. Thevtest for the ooint being in the rectanole on the rectanale and Artside the rectanole The
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