MUstar

IoT C++ 09/12 - Project3_Move.cpp

Sep 12th, 2017
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include"Move.h"
  3.  
  4. using namespace std;
  5.  
  6. Move::Move(double a,double b)
  7. {
  8.     x = a;
  9.     y = b;
  10. }
  11.  
  12. void Move::showmove() const
  13. {
  14.     cout<<"현재 댕댕이는 [x:"<<x<<"/y:"<<y<<"]에 있어요."<<endl;
  15. }
  16.  
  17. Move Move::Move_add(const Move & m) const
  18. {
  19.     Move dog;
  20.     cout<<"댕댕이는 [x:"<<m.x<<"/y:"<<m.y<<"]로 달립니다."<<endl;
  21.     dog.x+=m.x;
  22.     dog.y+=m.y;
  23.     return dog;
  24. }
  25.  
  26. void Move::reset(double a,double b)
  27. {
  28.     x = a;
  29.     y = b;
  30.     cout<<"댕댕이가  [x:"<<x<<"/y:"<<y<<"]에있는 주인의 곁으로 달립나다."<<endl;
  31.  
  32. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×