Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment, we will be creating classes that contain shapes described by a series of points. Points will be described by the Point structure:

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
For this assignment, we will be creating classes that contain shapes described by a series of points. Points will be described by the Point structure: struct Point [ double x, y Using the point structure, create a class called "Shape: Shape can contain an array or vector of Points. Use the following class definition for the shape class: class Shapel private: vector Point points; public: void addPoint(Point) Point getPoint(int); int getNumPoints(void); This shape class only contains member function prototypes. You will need to define the member functions themselves. The functions should behave as follows: addPoint should push a new point struct to the vector of points . getPoint should retrieve a point at the specified index. Be sure to check for boundary conditions! . getNumPoints should return the current vector length (10 Points) Three files are provided containing a series of points in the format x, y" Each file has a new point on each new line. When launching your program, add a file name as a command line parameter. The program should open the file, read all

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

1. Give extra points for correct and creative answers.

Answered: 1 week ago