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, 21.06.2019 21:00
Analyze the following code. int x = 1; while (0 < x) & & (x < 100) system.out.println(x++); a. the loop runs forever. b. the code does not compile because the loop body is not in the braces. c. the code does not compile because (0 < x) & & (x < 100) is not enclosed in a pair of parentheses. d. the numbers 1 to 99 are displayed. e. the numbers 2 to 100 are displayed.
Answers: 3
question
Computers and Technology, 22.06.2019 05:00
Lisa has a section of her document that she would like to include in the index. which option should lisa choose? mark index mark entry insert endnote add text
Answers: 3
question
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
question
Computers and Technology, 23.06.2019 21:40
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
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
Mathematics, 23.06.2021 02:30
question
Mathematics, 23.06.2021 02:30
question
Mathematics, 23.06.2021 02:30
question
Mathematics, 23.06.2021 02:30
question
Mathematics, 23.06.2021 02:30
question
Mathematics, 23.06.2021 02:30
Questions on the website: 13722359