subject

In this task, you are required to write a program that represents 2D Lines in the cartesian space. The program consists of three files: the header file (Line. h), the class file (Line. cpp) and the test file (Main. cpp). You are only required to complete the code in Line. cpp file. We already wrote the other two files. To understand what you need to do, read the codes in below. Sample Testcase 0:

Input:

-1 3 -3 9 1

Output:

Start point: (-1,3)
End point: (-3,9)
Slope = -3
Is line horizontal? no
Is line vertical? no
Does the line or its extension pass through the origin? yes
New end point after mirroring wrt x-axis: (-3,-3)

Sample Testcase 1:

Input:

2.5 4.5 3.5 4.5 1

Output:

Start point: (2.5,4.5)
End point: (3.5,4.5)
Slope = 0
Is the line horizontal? yes
Is the line vertical? no
Does the line or its extension pass through the origin? no
New end point after mirroring wrt x-axis: (3.5,4.5)

Sample Testcase 2:

Input:

7.2 3.1 22 12.6 -1

Output:

Start point: (7.2,3.1)
End point: (22,12.6)
Slope = 0.641892
Is the line horizontal? no
Is the line vertical? no
Does the line or its extension pass through the origin? no
New end point after mirroring wrt y-axis: (-7.6,12.6)

Sample Testcase 3:

Input:

1 4 1 19 1

Output:

Start point: (1,4)
End point: (1,19)
Slope = inf
Is the line horizontal? no
Is the line vertical? yes
Does the line or its extension pass through the origin? no
New end point after mirroring wrt y-axis: (1,-11)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 22.06.2019 21:00
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year school. what is the expected total cost for one year at the local community college if kirk lives at home? what is the expected total cost for one year at the out-of-state school if kirk lives on campus?
Answers: 2
question
Computers and Technology, 23.06.2019 16:50
15: 28read the summary of "an indian's view of indian affairs."15 betterin "an indian's view of indian affairs," it is asserted that conflicts could be reduced if white americansunderstood native americans..pswhich of the following would make this summary more complete? eleo the fact that chief joseph believes the great spirit sees everythinthe fact that chief joseph was born in oregon and is thirty-eight years oldo the fact that chief joseph states that he speaks from the hearthehehethe fact that chief joseph of the nez percé tribe made this claimebell- ==feetle===-felsefe ==submitmark this and retum.=
Answers: 3
question
Computers and Technology, 23.06.2019 18:40
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
You know the right answer?
In this task, you are required to write a program that represents 2D Lines in the cartesian space. T...
Questions
question
Computers and Technology, 19.09.2021 14:00
question
Mathematics, 19.09.2021 14:00
question
Mathematics, 19.09.2021 14:00
question
Mathematics, 19.09.2021 14:00
question
Mathematics, 19.09.2021 14:00
question
Mathematics, 19.09.2021 14:00
Questions on the website: 13722362