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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:30, brin1021
Jessie has received a contract to build a real-time application for a baker. however, the baker doesn't want to invest too much money. his only requirement is that he wants the customers to know which cupcakes are available at what time and in what quantity. so his core requirement is that the details of product should be in real time. what platform can jessie use to develop this application?
Answers: 1
image
Computers and Technology, 22.06.2019 11:30, lindalu
Hassan is writing his master’s thesis, which is a thirty-page document. he received some feedback from his professor in the form of comments, but does not see where the comments are. what is the fastest way for hassan to find the feedback?
Answers: 3
image
Computers and Technology, 23.06.2019 02:00, HannahVance99
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, legendman27
Jennifer has to set up a network in a factory with an environment that has a lot of electrical interference. which cable would she prefer to use? jennifer would prefer to use because its metal sheath reduces interference.
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 in other subjects:

Konu
Mathematics, 01.06.2021 04:00