subject

In this assignment, you will implement two classes. Point: A Point in a two dimensional plane has an integer x coordinate value and an integer y coordinate value. Rectangle: A Rectangle is a class that has three attributes: 1) Point type data that represent the top-left point of the rectangle, 2) integer length and 3) integer width. Write the appropriate class definition for Point class and Rectangle class with necessary constructors, mutator and accessor functions. Write a function that will take two objects of Rectangle class as parameter and return whether they intersect or not. Write a main function that will take inputs from user for two rectangles. Each rectangle requires 4 set of inputs: 1) x of top-left point, 2) y of top-left point, 3) length and 4) width. The main function will return the 4 set of coordinate values of the rectangles and whether they intersect or not. Print the 4 set of co-ordinate values of a rectangle in the following order: Top-left point Bottom-left point Bottom-right point Top-right point Sample Input: x of rectangle 1: 2 y of rectangle 1: 4 length of rectangle 1: 2 width of rectangle 1: 3 x of rectangle 2: 4 y of rectangle 2: 3 length of rectangle 2: 2 width of rectangle 2: 3 Sample Output: Co-ordinates of rectangle 1: (2,4), (2,2), (5,2), (5,4) Co-ordinates of rectangle 2: (4,3), (4,1), (7,1), (7,3) They intersect.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
Describe in pseudocode an algorithm that given an integer n and a linked list of elements increases the linked list by a factor of n by replacing each element in the original list with n copies of that element. for example, if l: [18, 7, 4, 24, 11] and n = 3 the resulting list should be l: [18, 18, 18, 7, 7, 7, 4, 4, 4, 24, 24, 24, 11, 11, 11]. if the value of n is less than or equal to 0, the list should be empty after the call. what’s the running time of your algorithm?
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Selling a product through an electronic medium is
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
question
Computers and Technology, 24.06.2019 00:40
To maintain clarity and focus lighting might be needed
Answers: 2
You know the right answer?
In this assignment, you will implement two classes. Point: A Point in a two dimensional plane has an...
Questions
question
Social Studies, 18.08.2019 10:00
question
Mathematics, 18.08.2019 10:00
question
Mathematics, 18.08.2019 10:00
question
Mathematics, 18.08.2019 10:00
question
Mathematics, 18.08.2019 10:00
question
Mathematics, 18.08.2019 10:00
Questions on the website: 13722362