can any1 help me ........ Consider a file input.txt which - TopicsExpress



          

can any1 help me ........ Consider a file input.txt which contains the employee hierarchy of a company, in the following format: Vineel Phatak, 5200000, NOBODY Ajay Joshi, 2500000, Vineel Phatak Abhishek Chauhan, 1200000, Ajay Joshi Vijaya Mundada, 600000, Abhishek Chauhan Rajan Gawli, 7000000, Vineel Phatak Sheila Rodrigues, 350000, Vineel Phatak Each line contains an employee name, a salary, and the name of the manager of that employee - all separated by commas. The special manager name NOBODY indicates that this employee does not have a manager (and is hence the CEO of the company). You can assume that there is only one CEO in the company. You have to write a program which reads input.txt (from the current directory), and computes the number of people who work under each employee. i.e. the total number of people under him/her in the employee hierarchy subtree (not including himself/herself). You should write the employee name and the number of people working under him to the file output.txt. For this input, your program should produce the following output: Vineel Phatak 5 Ajay Joshi 2 Abhishek Chauhan 1 Vijaya Mundada 0 Rajan Gawli 0 Sheila Rodrigues 0 Note: dont worry if the order of the lines in your output dont exactly match the order here, but the name and the number in each line must match perfectly. Also, make sure that each line consists of just one name followed by one blank space and one number, and nothing else.
Posted on: Fri, 07 Mar 2014 09:34:11 +0000

Trending Topics



Recently Viewed Topics




© 2015