View difference between Paste ID: tZzhX7Ye and xpAagV87
SHOW: | | - or go back to the newest paste.
1
#include <string>
2
3
using namespace std;
4
5
enum class AnimalType {
6
    Cat,
7
    Dog,
8
    Mouse,
9
};
10
11
class Animal {
12
public:
13
    
14
    Animal(AnimalType type, string name, string owner_name) {
15
        type_ = type;
16
        name_ = name;
17
        owner_name_ = owner_name;
18
    }
19
    
20
    AnimalType GetType() const {
21
        return type_;
22
    }
23
24
    const string& GetName() const {
25
        return name_;
26
    }
27
28
    const string& GetOwnerName() const {
29
        return owner_name_;
30
    }
31
32
private:
33
    AnimalType type_;
34
    string name_;
35
    string owner_name_;
36
};