Is the following program legal (assuming appropriate #include and using
directives are added)?
void show_employee_data(const Employee object);
int main( )
{
HourlyEmployee joe("Mighty Joe",
"123-45-6789", 20.50, 40);
SalariedEmployee boss("Mr. Big Shot",
"987-65-4321", 10500.50);
show_employee_data(joe);
show_employee_data(boss);
return 0;
}
void show_employee_data(const Employee object)
{
cout << "Name: " << object.get_name( ) << endl;
cout << "Social Security Number: "
<< object.get_ssn( ) << endl;