subject
Computers and Technology, 08.02.2021 17:30 kedest

Create a class Employee having private data members firstname as string, lastname as string and SSN(social security number) as string. Write getter and setter function for these data members. Also write
default and parameterized constructor for this class. Write pure virtual function double Earnings(). Write
another virtual function voidPrint() which prints first name, last name and SSN of Employee.
Class SalariedEmployee derived from Employee class. Private Data Member for this class is
weeklySalary as double. The public member functions include a constructor that initializes first name, last name,
SSN (social security number) and weekly salary; a set function to assign a new non negative value to data
member weeklySalary; a get function to return weeklySalary's value to the calling program. Function double
Earnings() overrides pure virtual function of Employee class to provide a concrete implementation that returns
the SalariedEmployee's weeklySalary. Function Print() of class SalariedEmployee overrides
Employee function void Print(). For this, call Employee Print function and getter of weeklySalary in this function.
Class HourlyEmployee is also derived from class Employee . Private Data members for this class are
hours and wage of type double. The public member functions include a constructor that initialize first name, last
name, SSN (social security number), an hourly wage and the number of hours worked; set function that assign
new values to data members wage and hours (hours takes value from 0 to 168 and wage is non-negative),
respectively, get functions to return the values of wage and hours, respectively. Function double
Earnings() overrides pure virtual function of Employee class to provide a concrete implementation that returns
wage x hours if hours less than 40 else return 40 x wage + ( ( hours - 40 ) x wage x 1.5 ); Now Function
void Print() of class HourlyEmployee overrides Employee class function void Print(). For this call Employee
Print function and return wage.
In main()create objects of child classes and Parent and call Earning() and Print() functions along with their name
and SSN. Also elaborate if polymorphism is being implemented here.

in c++ language..
object oriented programming...

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:10
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
You can apply several different worksheet themes from which tab?
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
question
Computers and Technology, 24.06.2019 10:50
In 2009 to 2010, how many social network users were reported as being victims of online abuse? a. 1 in 10 b. 100% c.1 in 100 d. 50%
Answers: 2
You know the right answer?
Create a class Employee having private data members firstname as string, lastname as string and SSN...
Questions
question
Mathematics, 27.09.2019 11:50
question
Chemistry, 27.09.2019 11:50
question
Mathematics, 27.09.2019 11:50