Question: 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:
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
Get step-by-step solutions from verified subject matter experts
