Question: Write a c++ program that accepts two ordered pairs (x2,y2) and (x1, y1) read input data from a file (points.dat). The file will contain an
Write a c++ program that accepts two ordered pairs (x2,y2) and (x1, y1) read input data from a file (points.dat). The file will contain an unknown number of data recordsprocess until end of file is encountered. Your program will compute the slope, the distance between the two points and the midpoint. Write the output report to a file. Remember the slope may be undefined. TEST data files will be posted on blackboard. 2 4 -3 9 5 6 -9 0 4 5 4 11 eof sample ouput file format below: OUTPUT REPORT Slope distance midpoint 0.45 78.99 (3, 2.5) -9.0 94.00 (-3, -5.9) Undefined Slope [(4, 5) & (4, 11)] 6.0 (4, 8) Record Count : 3 End of report
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
