Project #16378 - c++

 

 
 


For these problems, assume you have a class declared as follows:
class Coordinate {
private:
int x;
int y;
public:
Coordinate (int cx, int cy);
int getX ();
int getY ();
void setX (int cx);
void setY (int cy);
double distanctTo (Coordinate &other);
}
Also assume that the functions declared above are de ned, but that you cannot see that code.
1.
(1 point)
There is (at least) one syntax error above. Find it and correct it.
2.
(1 point)
Assume you are writing code within your
main
function. Write one line of code (one statement)
that will create a coordinate object as a local variable. Name it \center", and choose any names and
values needed to make your statement correct.
3.
(1 point)
Your statement above will call a function when it executes. What is the name and purpose
of the function that gets called?
4.
(2 points)
Write a second statement that declares a variable that points to a coordinate object, and
initialize it with a coordinate object created on the heap. Name it \edge".
 

 

Subject Computer
Due By (Pacific Time) 11/07/2013 08:42 pm
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy