Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

How can an entrepreneur launching a new business forecast sales?

Answered: 1 week ago