Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1CP: In previous chapters, you have created programs for the Greenville Idol competition. Now create a...
icon
Related questions
Question
C++
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
CS
5 class Coordinate {
6
7
8
9
10
11
12
13
14
15
25
26
27
28
29
30
31
32
33
34
35
public:
void SetXAndY (int coordinatex, int coordinateY) {
x= coordinatex;
y coordinateỸ;
16
17
18
19
20 };
21
22 int main() {
23
24
38
39
}
void Print Coordinate() const {
cout << x <<
}
int GetX() const { return x; }
int GetY() const { return y; }
private:
int x;
int y;
<< y << endl;
vector<Coordinate> locations;
Coordinate currCoordinate;
int currx;
int curry;
unsigned int i;
Scanne
cin >> currx;
cin >> curry;
while ((currx > 0) && (curry >= 0)) {
Y Your code goes here /
cin >> currX;
Curry:
L
CamScanner
for (i = 0; i < locations.size(); ++i) {
Transcribed Image Text: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 CS 5 class Coordinate { 6 7 8 9 10 11 12 13 14 15 25 26 27 28 29 30 31 32 33 34 35 public: void SetXAndY (int coordinatex, int coordinateY) { x= coordinatex; y coordinateỸ; 16 17 18 19 20 }; 21 22 int main() { 23 24 38 39 } void Print Coordinate() const { cout << x << } int GetX() const { return x; } int GetY() const { return y; } private: int x; int y; << y << endl; vector<Coordinate> locations; Coordinate currCoordinate; int currx; int curry; unsigned int i; Scanne cin >> currx; cin >> curry; while ((currx > 0) && (curry >= 0)) { Y Your code goes here / cin >> currX; Curry: L CamScanner for (i = 0; i < locations.size(); ++i) {
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT