Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the program in Python 3.9 please. Objectives: Practice implementing loops Practice writing conditions Practice implementing functions Assignment: For this lab assignment, we're going to

Create the program in Python 3.9 please.

image text in transcribed

image text in transcribed

image text in transcribed

Objectives: Practice implementing loops Practice writing conditions Practice implementing functions Assignment: For this lab assignment, we're going to be dealing with rectangles and an independent point. How we're going to determine where/how big your rectangle is located is through the x, y-coordinates of the lower left corner and upper right corner. So, like the following: (x1, y2) (x2, y2) (x1, y1) (x2, y1) We're testing your coordinate point (another independent x, y-coordinate pair) to see whether the point is inside the rectangle, outside the rectangle, or intersecting one of the lines of the rectangle. If the point is outside of the rectangle, we're then going to determine whether the point is north, south, east, west, or any combination (southeast, southwest, etc) in relation to the rectangle. The program should get the coordinates for the rectangle once. However, the user should be able to enter in however many points to test that they'd like. Note: North, south, east, and west should be inclusive on the respective axis. So, for instance, if the point is north of the rectangle, but the x-coordinate lies on the eastern border of the rectangle (so the point shares an x coordinate with the rectangle), then the point would be north, not northeast Specifications: Your program should achieve the assignment using three functions, defined as follows: main o Parameters: none o Return values: none Purpose: Gets input from the user Loops for points until the user no longer would like to (can assume the user enters correct input) Calls functions Only calls cardinalLocation is the point is outside the rectangle pointLocation o Parameters: rectangle coordinates, point coordinates (should have six total) Return values: boolean indication of inside/outside rectangle o Purpose: Determines whether the point is inside, outside, or intersecting the rectangle Informs the user of such (output inside function) Returns True for outside, False for anything else cardinalLocation O Parameters: rectangle coordinates, point coordinates (should have six total) Return values: none Purpose: Only ran if point was outside rectangle Determines whether point is north, south, east, west, northeast, northwest, southeast, or southwest of the rectangle Informs the user of such (output inside function) Hints: A lot of this program is just copying/pasting a lot of conditions (there's a lot). Make sure you utilize compound conditions -- you don't have to use nested conditions here (as in, it's not required) Work on this in parts -- it's not difficult work (once you have the correct conditions), just a lot of meticulous work

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_2

Step: 3

blur-text-image_3

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

Q.1. Taxonomic classification of peafowl, Tiger and cow ?

Answered: 1 week ago

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

5. Discuss the key components of behavior modeling training.

Answered: 1 week ago

Question

4. Develop a self-directed learning module.

Answered: 1 week ago

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago