#include<conio.h>
#include<iostream>
#include<string>
using namespace std;
class employ
{
public:
employ(const string &,const string &,double = 0.0);
void First(const string &);
string getName() const;
void Second(const string &);
string GetSecnd() const;
void add(double);
double prize();
private:
string first_name;
string last_name;
double erning;
};
employ::employ(const string & first,const string & last,double edit)
{
first_name=first;
last_name=last;
add(edit);
}
void employ::First(const string &first)
{
first_name=first;
}
string employ::getName() const
{
return first_name;
}
void employ::Second(const string &last)
{
last_name=last;
}
string employ::GetSecnd() const
{
return last_name;
}
void employ::add(double edit)
{
if(edit > 300){
erning=edit;
}
else
{
cout << "sorry menemom rupess 300";
}
}
double employ::prize()
{
return erning;
}
int main()
{
employ em("abdullah","masood");
em.add(3000);
cout << em.getName()<<" "<<em.GetSecnd();
cout << endl << em.prize();
getch();
return 0;
}
#include<iostream>
#include<string>
using namespace std;
class employ
{
public:
employ(const string &,const string &,double = 0.0);
void First(const string &);
string getName() const;
void Second(const string &);
string GetSecnd() const;
void add(double);
double prize();
private:
string first_name;
string last_name;
double erning;
};
employ::employ(const string & first,const string & last,double edit)
{
first_name=first;
last_name=last;
add(edit);
}
void employ::First(const string &first)
{
first_name=first;
}
string employ::getName() const
{
return first_name;
}
void employ::Second(const string &last)
{
last_name=last;
}
string employ::GetSecnd() const
{
return last_name;
}
void employ::add(double edit)
{
if(edit > 300){
erning=edit;
}
else
{
cout << "sorry menemom rupess 300";
}
}
double employ::prize()
{
return erning;
}
int main()
{
employ em("abdullah","masood");
em.add(3000);
cout << em.getName()<<" "<<em.GetSecnd();
cout << endl << em.prize();
getch();
return 0;
}