My Quote

Quote of the Day

sapient-2


Sapient Placements Paper on 30/09/2006

Posted by abhithakur

Question 1:
There is a company who has a number of employees. Every employee except the CEO can report to only one boss.
The class structure is given as
Employee :
:name,salary,isBoss
methods:getName,getSalary

Each employees cost to the company is the employees salary and if he is a boss the the sum of salarys of the employee and his subordinates

Expected deliverables were:
1.The class structure and
2.Method Float CostToTheCompany(String name)
which returns the cost to the company for the employee whos name is passed
suppose abhishek thakur is passed then the cost to the company will be Abhishek thakur's salary and sum of subordinates salaries working under Abhishek thakur.


question 2:
write a method that generates all four letter combinations like ABCD, ABGK, DHKO.Where four letters are in acending order .wrong combinations are BADC, PMOA etc.