GregLeck

Untitled

Feb 15th, 2022
1,021
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. class Dog
  6. {
  7. public:
  8.  
  9.     Dog();
  10.  
  11.     string Name;
  12.     int Age;
  13.     float Health;
  14.  
  15.     void Bark();
  16. };
  17.  
  18. int main()
  19. {
  20.     Dog Spot;
  21.  
  22.     system("pause");
  23. }
  24.  
  25. Dog::Dog()
  26. {
  27.     Bark();
  28.  
  29.     Name = "Fido";
  30.     Age = 10;
  31.     Health = 100.f;
  32. }
  33.  
  34. void Dog::Bark()
  35. {
  36.     cout << "woof" << endl;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment