December 21, 2015 · Public
Consider an existing file named tris.txt containing unknown number of lines (maximum number of lines in the file is 100). Each line contains 2 values of type double representing the sides of a square, a rectangle, or a wrong shape. A wrong shape is one in which any side is less than or equal to zero. A square is a geometric shape whose sides are equal. A rectangle is geometric shape whose sides are NOT equal.
Write a C++ program that reads the contents of the file tris.txt into 2 parrallel arrays, counts and prints on the screen the number of squares, rectangles, and wrong shapes. In addition, it displays all shapes types in the same order as they appear in the file. Sample I/O is shown below.