blob: df7ffd9958dc8eac1aef2339f1b215eba7799051 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <string>
using namespace std;
class Cow
{
// The reason these have private access
// is that their no way a cow's name and breed can be changed.
string name;
string breed;
public:
unsigned age;
Cow (string n, string b, unsigned a) : name {n}, breed {b}, age {a} {}
Cow (string n, string b) : name {n}, breed {b}, age {0} {}
void moo ();
};
|