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

Other questions on the subject: Computers and Technology

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
image
Computers and Technology, 23.06.2019 04:31, hargunk329
Q13 what function does a security certificate perform? a. creates user accounts b. scrambles data c. identifies users d. creates password policies e. provides file access
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, carolelai08
Stops: using the information learned in this course, explain three things you will not do when driving. a. b. c. explain why you will not do these things when driving. starts: using the information learned in this course, explain three things you will do when driving. a. b. c. explain why you will do these particular things when driving. explain one thing you will stop doing as a passenger. explain one thing you will start doing as a passenger.
Answers: 3
image
Computers and Technology, 24.06.2019 02:10, ttangelique
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
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 in other subjects:

Konu
Biology, 23.08.2019 11:30