• Post Reply Bookmark Topic Watch Topic
  • New Topic

Employee Class problem  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create an employee class with the following properties:ID (int), FName(string), LName(string).
(Functionality) to track an employee's manager and subordinates.
Add a method that displays the names of all subordinates for a given employee.
Do not use multiple classes.(Use Tree Traversal)
 
Sheriff
Posts: 23512
47
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amruta, welcome to the Ranch!

It looks like you could benefit from reading quite a few of the sections of our HowToAskQuestionsOnJavaRanch FAQ. So please do that (follow the link) and then come back and post a question.
 
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

amruta shah wrote:Do not use multiple classes.(Use Tree Traversal)


Tree Traversal? means? .. can you elaborate...sorting is needed?
 
amruta shah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Seetharaman Venkatasamy wrote:

amruta shah wrote:Do not use multiple classes.(Use Tree Traversal)


Tree Traversal? means? .. can you elaborate...sorting is needed?



It means maintain a list of managers and employees who report to that manager and when input is the manager name display the list of all the employees who report to that manager.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then create a Manager class which has a List of Employee
 
Marshal
Posts: 59146
180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!