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, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
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, 13.03.2021 05:20
question
Mathematics, 13.03.2021 05:20
question
English, 13.03.2021 05:20
question
Mathematics, 13.03.2021 05:20
question
Mathematics, 13.03.2021 05:20