-
Notifications
You must be signed in to change notification settings - Fork 0
/
cat.cpp
43 lines (38 loc) · 955 Bytes
/
cat.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* =====================================================================================
*
* Filename: cat.cpp
*
* Description: Definition file for the cat class.
*
* Version: 1.0
* Created: 02/01/13 20:47:58
* Revision: none
* Compiler: gcc
*
* Author: Robert Halliday (rh), [email protected]
* Company: rphhpr
*
* =====================================================================================
*/
#include "cat.hpp"
Cat::Cat(int initialAge)
{
itsAge = initialAge;
}
Cat::~Cat()
{
}
// create a cat, set its age, have it meow, tell us its age, then meow again.
int main()
{
Cat Frisky(5);
Frisky.Meow();
std::cout << "Frisky is a cat who is ";
std::cout << Frisky.GetAge() << " years old.\n";
Frisky.Meow();
Frisky.SetAge(7);
std::cout << "Now Frisky is ";
std::cout << Frisky.GetAge() << " years old.\n";
return 0;
}