Computers and Technology
Computers and Technology, 14.08.2020 22:01, cynthiakk

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)

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, Geo777
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, jack487
How can a user delete a drawing object
Answers: 1
image
Computers and Technology, 23.06.2019 18:40, cyn95xx
Johnson enterprises uses a computer to handle its sales invoices. lately, business has been so good that it takes an extra 3 hours per night, plus every third saturday, to keep up with the volume of sales invoices. management is considering updating its computer with a faster model that would eliminate all of the overtime processing.
Answers: 2
image
Computers and Technology, 24.06.2019 17:40, maxdmontero
This assignment continues work on the online booking facility introduced at the end of chapter- 10. the work will be continued in the assignments for chapters 14 and 15 (a) assume that you will produce your online booking facility using an agile approach. i. suggest the kind of user research you would like to conduct for your product before iteration cycles begin. ii prioritize the requirements for your product according to business value, i. e which requirements are likely to provide the greatest business benefit, and sketch out the ux design work you would expect to undertake during the first four iteration cycles, i. e. cycle 0, and cycles 1 to 3. (b) using one of the mockup tools introduced above, generate a mockup of your product's landing page, as developed in the assignment for chapter-11 (c) using one of the patterns websites listed previously, identify suitable interaction patterns for elements of your product, and develop a software-based prototype that incorporates all the feedback and the results of the user experience mapping achieved at the end of chapter-11. if you do not have experience in using any of these, create a few html web pages to represent the basic structure of your website
Answers: 2
Do you know the correct 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
Mathematics, 18.03.2021 21:10
Konu
Mathematics, 18.03.2021 21:10
Konu
History, 18.03.2021 21:10