Question

Make an instance of the rectangle in the first quadrant (the area of the Cartesian coordinate system in which both X and Y are positive and depicted in the upper right) at the origin and passing through (7,2) and use the method compute_area from above to compute its area. Please answer on Python.

          Make an instance of the rectangle in the first quadrant (the area of the Cartesian coordinate system in which both X and Y are positive and depicted in the upper right) at the origin and passing through (7,2) and use the method compute_area from above to compute its area. Please answer on Python.
        
Show more…

Added by Dana G.

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
Make an instance of the rectangle in the first quadrant (the area of the Cartesian coordinate system in which both X and Y are positive and depicted in the upper right) at the origin and passing through (7,2) and use the method compute_area from above to compute its area. Please answer on Python.
Close icon
Play audio
Feedback
Powered by NumerAI
David Collins Ivan Kochetkov
Kathleen Carty verified

Jordan Gassaway and 78 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
geometry-find-the-bounding-rectangle-a-bounding-rectangle-is-the-minimum-rectangle-that-encloses-a-s

(Geometry: find the bounding rectangle) A bounding rectangle is the minimum rectangle that encloses a set of points in a two-dimensional plane, as shown in Figure 12.16. Write a method that returns a bounding rectangle for a set of points in a two-dimensional plane, as follows: def getRectangle(points): You defined the Rectangle2D class in Exercise 8.19. Write a test program that prompts the user to enter the points as x1 y1 x2 y2 x3 y3 ... in one line, and displays the bounding rectangle’s center, width, and height. Here is a sample run:

Introduction to Programming Using Python

geometry-two-rectangles-write-a-program-that-prompts-the-user-to-enter-the-center-x-y-coordinates--3

(Geometry: two rectangles) Write a program that prompts the user to enter the center $x$ -, y-coordinates, width, and height of two rectangles and determines whether the second rectangle is inside the first or overlaps with the first, as shown in Figure 4.15

Introduction to Programming Using Python

geometry-two-rectangles-write-a-program-that-prompts-the-user-to-enter-the-center-x-y-coordinates--2

(Geometry: two rectangles) Write a program that prompts the user to enter the center $x=, y$ -coordinates, width, and height of two rectangles and determines whether the second rectangle is inside the first or overlaps with the first, as shown in Figure $4.10 .$ Test your program to cover all cases.

Introduction to Programming Using Python


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,724 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,372 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,773 solutions

*

Transcript

-
00:02 Okay, for this problem, they'd like us to find a bounding rectangle for a list of points, and then they want that to be converted to the rectangle 2d class that we wrote back in chapter 7, and they'd like us to print out the center and height and width of that rectangle.
00:23 I've written here just our little test program that will collect the input from the user, the list of points, we have to go every other point to collect the xy pairs.
00:39 They also need to be converted to floats.
00:41 We then call our function get rectangle and then print out the requested values.
00:52 To write our get rectangle function, essentially what we're going to do is we're just going to find the largest and the smallest of each of the x and y sets.
01:04 And those are going to be the corners of our bounding box.
01:07 And then from there, we can compute the center, the height and width of the rectangle, and make the actual rectangle.
01:14 I'm going to write a couple utility functions to help with finding the center and getting the length.
01:24 So you get the center, assuming that we have a max and a min.
01:31 I'm going to return the sum, and then divide by two.
01:51 And then for length, we're just going to return the difference...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Join the community

18,000,000+

Students on Numerade


Trusted by students at 8,000+ universities

Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever