Question: c++ Your main() function must: . Open (check they are opened) and close the input and the output files Call getPoint(), calcLength and printDistance() las

c++
Your main() function must: . Open (check they are opened) and close the input and the output files Call getPoint(), calcLength and printDistance() las many times as needed Call calcArea () Format the output so real numbers are printed in fixed format Print the area of the triangle to the output file HEN Note: The coordinates of vertices must be printed with a single decimal digit while the distances and the area must be printed with 2 decimal digits. Unless specified otherwise ali Values double precision real numbers. You can declare all the variables that you need. All the functions must be declared below main 2) You can use can use ONLY the material learned and used in the first 10 lab assignments. 3) Your program must pass all my tests. 4) You must choose the most appropriate type of function and type of parameters for each of the functions described above. The program must compile without errors or warnings. Open hw2_TXX. cpp in your IDE and implement your solution. Enter your algorithm (as comments) and implement it in C++ Note: in DO NOT remove or modify the statements that I use to test certain things your program. . Run my sample solution to know how your program must behave. Pay attention to the input and the output formats Your solution must behave exactly like mine. Carefully analyze the sample run shown below and use it as a reference to ensure you do the right things. Try the values in the provided input file and check t you get the right result X compare with my solution) if you get an enor message on the output read the comment on the line specified in the message to find out what is wrong. Next, test your program using different values in the input file Sample run of the program Given the following content of the input file 1.03 6.0 3.04 1.19 5.96 6.5 The content of the output file should be The distance between (1.0,1.2) and (6.0, 6.0) is 6.93 The distance between (6.0, 6.0) and (3.0, 6.5) is 3.04 The distance between (1.0, 1.2) and (3.0,6.5) is 5.66 The area of this triangle is: 8.45
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
