#include "Employee.h"
#include <iomanip>

Employee::Employee()
	: salary(0.0) // base class' default constructor is called here
{
}

istream &Employee::load(istream &input)
{
	Person::load(input) >> salary;
	input.ignore();
	return readline(input, departments);
}

ostream &Employee::print(ostream &output) const
{
	return Person::print(output)
			<< " c" << fixed << setprecision(2) << salary << ": " << departments << endl;
}

SocioeconomicalStatus Employee::getSocioeconomicalStatus() const
{
	if ( salary > 5000000 ) return socioeconomicalStatusRich;
	if ( salary > 1500000 ) return socioeconomicalStatusHigh;
	if ( salary > 750000 ) return socioeconomicalStatusMedium;
	if ( salary > 400000 ) return socioeconomicalStatusLow;
	if ( salary > 0 ) return socioeconomicalStatusPoor;
	return socioeconomicalStatusUnknown;
}
