Computers and Technology
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...

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:30, ruddymorales1123
Linda subscribes to a cloud service. the service provider hosts the cloud infrastructure and delivers computing resources over the internet. what cloud model is linda using
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, Need1ng
The more powerful, 60 volt cables and the main power shut-off on an hev are both colored orange.
Answers: 1
image
Computers and Technology, 23.06.2019 20:30, kaylee2828
Column a of irma’s spreadsheet contains titles for each row, but her document is too big and will be printed three pages across. she wants to be sure that every page will be understood. what can irma do to with this problem?
Answers: 3
image
Computers and Technology, 24.06.2019 10:20, savyblue1724707
Identify the publisher in this citation: carter, alan. a guide to entrepreneurship. new york: river’2008.print.
Answers: 3
Do you know the correct answer?
Create a class Employee having private data members firstname as string, lastname as string and SSN...

Questions in other subjects: