Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "iostream"
  3. #include "string"
  4.  
  5. using namespace std;
  6.  
  7. class Birds {
  8. public:
  9.     void setEyes(int eyes);
  10.     double getEyes(void);
  11.     Birds();
  12.  
  13. protected:
  14.     int eyes;
  15.     double wings;
  16.  
  17.  
  18. };
  19.  
  20. Birds::Birds(void) {
  21.  
  22. }
  23.  
  24. void Birds::setEyes(int eyes) {
  25.     eyes = 2;
  26.  
  27. }
  28.  
  29. double Birds::getEyes(void) {
  30.     return eyes;
  31.  
  32. }
  33. int main()
  34. {
  35.     Birds lucas;
  36.  
  37.     lucas.setEyes(2);
  38.     cout << "Number of eyes :" << lucas.getEyes() << endl;
  39.  
  40.  
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement