#include<iostream.h>
#include<conio.h>
#include<string.h>
class employee
{
char name [80 ];//private by default
public:
void putn(char *n);//these are public
void getn(char *n);
private:
double wage;
public:
void putw(double w);
double getw();
};
void employee::putn(char *n)
{
strcpy(name,n);
}
void employee::getn(char *n)
{
strcpy(n,name );
}
void employee::putw(double w)
{
wage =w;
}
double employee::getw()
{
return wage;
}
void main()
{
clrscr();
employee emp;
char name [80];
emp.putn("Rani");
emp.putw(25000);
emp.getn(name);
cout <<name <<" makes $";
cout <<emp.getw()<<" per year.";
getch();
}