Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions