Advertisement
Guest User

Untitled

a guest
Jul 8th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. //6. Here’s a class declaration:
  2. class Move {
  3. private:
  4.     double x;
  5.     double y;
  6. public:
  7.     Move(double a = 0, double b = 0); // sets x, y to a, b
  8.     showmove() const; // shows current x, y values
  9.     Move add(const Move & m) const;
  10.         // this function adds x of m to x of invoking object to get new x,
  11.         // adds y of m to y of invoking object to get new y, creates a new
  12.         // move object initialized to new x, y values and returns it
  13.     reset(double a = 0, double b = 0); // resets x,y to a, b
  14. };
  15. //Create member function definitions and a program that exercises the class.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement