Recently I participated in an interview asked this question.
This is the scenario.
We have two types of employees. Regular and contract employee regular employees will be paid on a fixed basis at the end of the month. The employees of the contract will be paid weekly on the basis of hours of work hours.
Managers will be assigned to these employees for supervision. A manager may have regular and contracted employees.
This application will calculate payroll for these employees.
They asked me to come up with class design for this situation.
What is the interviewer expecting me? Indicators in this direction will be highly appreciated.
One of the following designs can be
Design 1. Public class employees {Public Bull's Contract Workers (Receive; Set;} Public Abstract Float CalCulatePayroll ();} Public Square Fulltime: Employee {Public Override Float Calculate Parole ()} {} } Public Category Contract Emp: Employee {Public at NOF HR {Received; Set;} Public Override Float CalCulatePayroll () {sal = nohr * money;}}
Design 2.
public class employees {public Boole's Contempt Employee {}; Set;} Public ET Nof HR {Received; Set;} Public Float CalCulatePayroll () {If based on calculation based on (this.isContractEmployee) {// HR} else {// calculate regurlare sal }}}
Comments
Post a Comment