Honestly, if you just get out a piece of paper and draw yourself a cartesian numberline and a square, then play with figuring out how to tell if a point is in or out of the square, then you will get it fairly quickly and have a very good understanding of how to make it work.
This is fine, when storing names/anything else in array1.
I store the coordinates in array2 because I have no idea how to store 4 (x,y) points into 1 variable and extract them when trying to match them.
So whenever I try the virtual and dynamic way which is.
Adding a virtual and also changing the arrays to
For the first array1 with the new *. It is fine. Nothing is wrong.
But when it comes to the second new array, it hangs whenever I put this array in. Is there any way to go about this?
void stringToUpper(string &s);
void stringToUpper(string &s)
for(unsignedint l = 0; l < s.length(); l++)
s[l] = toupper(s[l]);
cout<<"1) input x y coords"<<endl;
cout<<"Q) q to quit<<endl<<endl;
string shape, special;
while ( !quit )
cout<<"Please enter your choice : ";
menuChoice = toupper(menuChoice);
cout<<endl<<"input x,y coords"<<endl;
cout<<"Please enter name of shape : "<<endl;
cout<<"You choosen 3"<<endl<<endl;
cout<<"You choosen 4"<<endl<<endl;
cout<<"You have chosen to quit!"<<endl<<endl;
For the main program, I will also add in codes for the user to enter coords X and Y. Now the problem for me is, how do I input data for x,y and store them. I might play around with the ideas you gave me.
Do you get a clearer point of view here? Am I able to call the one at Square setXY, when I know that the input of the shape is 'Square' at the main program, then storing the coords?