Answer:
The solution code is written in Python:
Explanation:
Firstly, we can use Python built-in method input() to get coordinates for three points from user (Line 3). To simplify the entry process, the input of the three coordinates is expected in a single string 0.0 0.0 3.0 4.0 6.0 8.0O. Please note each of the coordinates is separated by a single space.
Next, we can proceed to use Python string split() method and single space character " " as separator to break the input string of coordinates into a list of individual numbers ["0.0", "0.0", "3.0", "4.0", "6.0", "8.0"].
Prior to calculating the line segment, it is important to ensure the coordinates in the list, coordList, have been converted from string to float type (Line 6 - 7).
Next, we are ready to apply the Distance formula to calculate the length of the two line segments that join the three coordinates (Line 9 and Line 11). The distance formula is [tex]\sqrt{ (x1 - x2){^2} + (y1 - y2){^2} }[/tex]
At last, sum up the two line segments, seg_1 & seg_2 and print it in the terminal (Line 13).