Question: python program geometry tool Description: Suppose you are a software engineer at Shepards, a software company focusing on developing simulation software and scientific computing tools.
python program geometry tool
Description: Suppose you are a software engineer at Shepards, a software company focusing on
developing simulation software and scientific computing tools. You are assigned to create a class
that can compute the attributes of a rectangle and the relationship between a rectangle and
another geometry object.
Below are the detailed requirements of the class that you need to develop.
Goals: Define the MyRectangleD class that contains:
Two double data fields named x and y specify the center of the rectangle with getter and
setter methods. Assume that the rectangle sides are parallel to x or yaxes.
The data fields width and height with getter and setter methods.
A constructor that creates a default rectangle with for x y and for both width
and height.
A method getarea that returns the area of the rectangle.
A method getperimeter that returns the perimeter of the rectangle.
A method containpointx y that returns true if the specified point x y is inside
this rectangle see Figure a
A method containsrectangled that returns true if the specified rectangle is inside this
rectangle see Figure b
A method overlapsrectangled that returns true if the specified rectangle overlaps
with this rectangle see Figure c
Task I: Draw the UML diagram for the class and then implement the class.
Task II: Write a test program that
a creates a MyRectangleD object r with
b displays the area and perimeter of r
c displays the result of rcontainpoint
d displays the result of rcontainsMyRectangleD
e and roverlapsMyRectangleD
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
