define the myrectangle2d class that contains: ■ two double data

Project Description:

define the myrectangle2d class that contains:■ two double data fields named x and y that specify the center of the rectangle with get and set methods. (assume that the rectangle sides are parallel to x- or y- axes.)■ the data fields width and height with get and set methods.■ a no-arg constructor that creates a default rectangle with (0, 0) for (x, y) and 1 for both width d height.■ a constructor that creates a rectangle with the specified x, y, 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 contains(double x, double y) that returns true if the specified point (x, y) is inside this rectangle. see figure 10.15(a).■ a method contains(myrectangle2d r) that returns true if the specified rectangle is inside this rectangle. see figure 10.15(b).■ a method overlaps(myrectangle2d r) that returns true if the specified rectangle overlaps with this rectangle. see figure 10.15(c).draw the uml diagram for the class. implement the class. write a test program that creates a myrectangle2d object r1 (new myrectangle2d(2, 2, 5.5, 4.9)), displays its area and perimeter, and displays the result of r1.contains(3, 3), r1.contains(new myrectangle2d(4, 5, 10.5, 3.2)), and r1.overlaps(new myrectangle2d(3, 5, 2.3, 5.4)).
Skills Required:
Project Stats:

Price Type: Negotiable

Expired
Total Proposals: 12
1 Current viewersl
11 Total views
Project posted by:

Proposals

Proposals Reputation Price offered
  • 3.8
    30 Jobs 19 Reviews
    $0 in 0 Day
  • 4.8
    290 Jobs 208 Reviews
    $0 in 0 Day
  • 4.0
    72 Jobs 31 Reviews
    $0 in 0 Day
  • 4.5
    355 Jobs 236 Reviews
    $0 in 0 Day
  • 0.0
    0 Jobs 0 Reviews
    $0 in 0 Day
  • 5.0
    1 Jobs 1 Reviews
    $0 in 0 Day
  • 4.9
    95 Jobs 45 Reviews
    $0 in 0 Day
  • 5.0
    1 Jobs 1 Reviews
    $0 in 0 Day
  • 4.8
    60 Jobs 32 Reviews
    $0 in 0 Day
  • 0.0
    0 Jobs 0 Reviews
    $0 in 0 Day