Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 belowStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started