#include <iostream>
#include <conio.h>
class cho // loai cho //begin declaration of the class
{
public:
cho(int,int); // constructor Ham khoi tao
~cho(); // destructor Ham huy
int getAge();
void setAge(int);
void gau();
private:
int itsAge; // member variable of private section
};
//constructor of cho
cho::cho(int initialAge)
{
itsAge=initialAge;
}
//destructor , take no action
cho::~cho()
{
}
//Getage , public accessor function , return value of itsAge member
int cho::getAge()
{
return itsAge;
}
//definition of setAge , public
//accessor function
void cho::setAge(int age)
{
itsAge=age;
}
//definition of gaugau method , returns: void , prameters : none
// action : Prints "gaugau " to screen
void cho::gau()
{
}
int main()
{
cho nick(8); //dinh nghia nick voi tuoi la 8
nick.gau();
cout << nick.
getAge() << " tuoi\n"; nick.gau();
nick.setAge(10); // thiet lap gia tri tuoi moi ,thay doi tuoi
cout << "bay gio nick da la " << nick.
getAge() << " tuoi\n"; getch();
}