### Inputting a user-specified number of points and manipulating a specific one

I'm terribly sorry for the long and probably unhelpful title, but I really can't think of a better way to put it.

I have a problem here, and I think I know how to do it, except for what I've put in bold:

Your program will prompt a user for a set of points [as in, on a Cartesean plane], first asking how many points will be in the set, then reading in the points. The program then offers the user the following menu until the user exits:

A) enter a new set of points [will restart from the begining]
B) move a particular point along the x axis, y axis, or x and y axis
C) mirror a particular point along the x axis, y axis, or x and y axis
D) output all of the points in their current state
E) exit

That is, I know how to read in a set number of points and manipulate a single one, but I don't know how to do it with a user-specified (and thus unknown) number of points.

I don't know if this will be helpful or just extra information, but:
-all points will be integers
-I must use a class, Point

Once I know where to start with manipulating a specific point, I think the rest will be manageable.

Thanks much!
Tei
 first asking how many points will be in the set, then reading in the points.

Sample code:
 ``12345`` ``````cout << "How many points would you like to enter? "; cin >> numPoints; for (int i = 0; i < numPoints; i ++) cin >> myArrayOfPoints[i].X >> myArrayOfPoints[i].Y;``````

 move a particular point along the x axis, y axis, or x and y axis

Sample code:
 ``1234567891011`` ``````cout >> "Please choose a point to move: " for (int i = 0; i < numPoints; i ++) cout << i + 1 << ") " << myArrayOfPoints[i].X << " " << myArrayOfPoints[i].Y << "\n"; cin >> pointToMove; cout << "Please enter the new X and Y coords: "; cin >> toX >> toY; myArrayOfPoints[i - 1].Move(toX, toY);``````

I'm sure you should be able to work out how to implement those pieces into your code.
Arrays! That never even crossed my mind!

Thank you so very much!
Another option is to use vectors (pun intended) if you need to have dynamically sized arrays.
Well, we haven't done vectors in class, so I think I'll stick to the arrays--that's something we've done.

...I missed the pun...I don't think I know enough for programming humor to make sense to me just yet ^^;
Points are a geometry term, as is vectors...
You know, I didn't do much better in geometry than I'm doing in C++ ;)
Topic archived. No new replies allowed.