Question: the last one is the file i will read from shapes.txt Styles For the second part of this assignment, you'lbe reading in data from a



the last one is the file i will read from shapes.txt
Styles For the second part of this assignment, you'lbe reading in data from a file. The file shop under Resources for this assignment) contains the name of a shape followed by the vertices of the shapes. An example is es.txt (available shown below: Triangle -1 0 e 1 1 0 square 0 1 1 1 1 This data would correspond to a triangle with the following vertices: And a square with the following vertices So the I -coordinate of each vertex is listed before the y -coordinate, and allvalues are separated by space. When reading the shapes from the file, store the shape name in a std: :string variable and the and values in their own double variable. Structure your code so that after the program reads in a shape's name, it begins to repeatedly read a vertex until it encounters the next name OR it reaches the end of the file. Note that both of these cases would set the fail flag. See the basic algorithm below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
