SHARE
TWEET

Untitled

a guest Mar 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. class Human {
  5.  
  6.     public:
  7.    
  8.     virtual void sleep()=0;
  9.     virtual void work() {
  10.         cout<<"I'm working.\n";
  11.        
  12.     }
  13.  
  14. };
  15. class student:public Human{
  16.   public:  
  17.   void sleep(){
  18.       cout<<"I'm sleeping.\n";
  19.      
  20.   }
  21.   void  work(){
  22.       cout<<"I don't like work.\n";
  23.   }
  24. };
  25.  
  26. int main()
  27. {
  28.     student kent;
  29.     kent.sleep();
  30.     kent.work();
  31.    
  32.  
  33.    return 0;
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top