Description
You are given with a partial implementation of three classes: Point2D, Circle, and Rectangle. Complete the implementation according to the following instructions. Note that the numbers inside brackets specify the marks allotted to each task.
Point2D: [4 Marks]
-[2]Complete setX funciton
-[2]Complete getX function
Circle: [16 Marks]
-[2]write a default constructor that initializes all values to 0
-[2]Complete the all-argument constructor: Circle(Point2D c, double r)
-[2]write getter and setter methods for this class
-[2]Complete the intersect(Circle rhs) function that determines if this circle intersects with another circle rhs
-[2]Complete the contains(Circle rhs) function that determines if this circle contains another circle rhs
-[2]Complete contains(Point2D p) function that determines if this circle contains a point p
-[2]Complete perimeter() function that returns perimeter of the circle -[2]write a destructor that sets all values to 0
Rectangle: [25 Marks]
-[3]define two variables that specifies the rectangle in a 2d space the variables should represent: topright point, bottom-left point
-[2]write a default constructor that initializes all values to 0
-[3]write an all-argument constructor that accepts values of all member variables and set the members variables accordingly
-[2]write getter and setter methods for this class
Homework prepared by Sukarna Barua, Asst. Professor, CSE, BUET
-[2]Complete the area() function that returns area of the rectangle
-[3]Complete the intersect(Rectangle rhs) function that determines if this rectangle intersects with another rectangle rhs
-[3]Complete the contains(Rectangle rhs) function that determines if this rectangle contains another rectangle rhs
-[3]Complete inside(Circle c) function that determines if this rectangle is completely inside a circle c
-[2]Complete the perimeter() function that returns perimeter of the rectangle -[2]write a destructor that sets all values to 0
Main: [5 Marks]
-Create suitable examples to demonstrate all functionalities as specified in the cpp file.
More practice: [For online]
-Extend your program to include facilities for other geometric objects such as square, triangle, ellipse, etc.
Homework prepared by Sukarna Barua, Asst. Professor, CSE, BUET
Reviews
There are no reviews yet.