You don't know how to write a function that will set a value?
You don't know how to write a function that will get a value?
Even with the examples given?
[edit]If I gave you some prototypes, do you think you could make an attempt at filling in the rest?
#include <iostream>
#include <string>
using namespace std;
class employee
{
string first;
string last;
int salary;
public:
employee() : first(""), last(""), salary(0) {}
string getfirst();
string getlast();
int getsalary();
void setfirst(string f);
void setlast(string l);
void setsalary(int s);
};
string employee::getfirst()
{
// ...
}
string employee::getlast()
{
// ...
}
int employee::getsalary()
{
// ...
}
void employee::setfirst(string f)
{
// ...
}
void employee::setlast(string l)
{
// ...
}
void employee::setsalary(int s)
{
// ...
}