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, 22.06.2019 01:00
What is added to the < meta > tag to describe the encoding type?
Answers: 2
question
Computers and Technology, 22.06.2019 23:50
You need to design a circuit that implements the functions in the following table: s0 s1 function0 0 a + 10 1 a – b1 0 a + b1 1 a – 1s0 and s1 are 1-bit control inputs to select the function of the circuit. inputs a and b are 4-bitnumbers in 2s complement form. the output is also a 4-bit number in 2s complement form.you are allowed to use only one ttl 7483 4-bit adder to implement all the functions. but anynumber of other components (except the adder) can be used.hint: design a combinational logic circuit to modify the input b and the “carry input” of theadder depending on the control inputs s0 and s1.important: lab grade will depend on the working of the circuit & will be checked of by your labinstructor.1. is the output valid for the following input combinations: a. s0 = 0, s1 = 0, a = 7, b = 3? b. s0 = 0, s1 = 1, a = 7, b = 3? c. s0 = 1, s1 = 0, a = -4, b = -5? d. s0 = 1, s1 = 1, a = -8, b = 6? 2. what is the range of inputs (for both a and b) that will produce the valid output for all the functions?
Answers: 3
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
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
Biology, 09.03.2021 05:30
question
Physics, 09.03.2021 05:30
question
Mathematics, 09.03.2021 05:30
question
Mathematics, 09.03.2021 05:30
Questions on the website: 13722361