Question: Write code to assign x and y coordinates to currCoordinate, and store currCoordinate in locations. Input first receives an x value, then a y value.

Write code to assign x and y coordinates to currCoordinate, and store currCoordinate in locations. Input first receives an x value, then a y value. Input example: 12 32 88 2 -1 -1

#include #include using namespace std;

class Coordinate { public: void SetXAndY(int coordinateX, int coordinateY) { x = coordinateX; y = coordinateY; } void PrintCoordinate() const { cout << x << " - " << y << endl; } int GetX() const { return x; } int GetY() const { return y; }

private: int x; int y; };

int main() { vector locations; Coordinate currCoordinate; int currX; int currY; unsigned int i;

cin >> currX; cin >> currY; while ((currX >= 0) && (currY >= 0)) {

/* Your code goes here */

cin >> currX; cin >> currY; }

for (i = 0; i < locations.size(); ++i) { currCoordinate = locations.at(i); currCoordinate.PrintCoordinate(); }

return 0; }

c++ and please please make it correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!