subject

In this assignment, you wil implement two classes. 1. Point: A Point in a two dimensional plane has an integer x coordinate ad an integery 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. 2. Write the appropriate class definition for Point class and Rectangle class with necessary c 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 returr 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: 1. Top-left point 2. Bottom-left point 3. Bottom-right point 4. 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: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
In this assignment, you wil implement two classes. 1. Point: A Point in a two dimensional plane has...
Questions
question
English, 18.06.2021 14:00
Questions on the website: 13722362