Results 1 to 4 of 4
  1. #1
    payal is offline Member
    Join Date
    Sep 2011
    Posts
    1
    Rep Power
    0

    Default need a simple code for the following

    Read Departments and Employees from a file, and print a sorted list of employees for a specified department.
    Assume the file follows the following data:
    Dept:10, Accounts, Boston
    Emp:1, john, doe, 10000
    Emp:2, jane, doe, 20000
    Emp:3, sarah, smith, 30000
    Dept:20, Development, Moscow
    Emp:4, ivan, pavlov, 10000
    Emp:5, dmitry, panov, 20000
    Emp:6, sergei, meigyesi, 30000
    Dept:30, Marketing, Beijing
    Emp:7, yao, ming, 20000
    Emp:8, michelle, yeoh, 30000

    Provide the following command line menu:
    1. Read from file // if the user chooses this option, ask for file name and load the above data from that file
    2. Print sorted list of all departments
    3. Print List of all employees for a department, sorted by name
    4. Print List of all empoloyees for a department, sorted by salary

    note: The data of the employees contain lower-case data for names. But you will print the employees in Title Case.


    From the data in the file, I need to see the part of the line before the first ":" to know whether it is
    a dept record or an emp record then, from the data after the ":", i need to take the data between the commas and
    construct a Dept object or an Emp object then i need to do the sorting of the emp objects as per the menu
    option chosen by the user, as mentioned in the question.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: need a simple code for the following

    Quote Originally Posted by payal View Post
    need a simple code for the following...
    I think I speak for all in wishing you the greatest success in creating this code and in passing your assignment. But please understand that we are not here to provide you with "simple code for the following". Please show us *your* code and ask any specific questions, and we'll be more than happy to help.

  3. #3
    kammce's Avatar
    kammce is offline Senior Member
    Join Date
    Dec 2010
    Location
    California
    Posts
    194
    Rep Power
    4

    Default Re: need a simple code for the following

    Have you started writing the program yet? or are you still in the structural programming development stages?
    My API:
    Java Code:
    cat > a.out || cat > main.class

  4. #4
    Join Date
    Sep 2011
    Posts
    18
    Rep Power
    0

    Default Re: need a simple code for the following

    A good starting place might be researching about reading and writing (input/output) files online.

Similar Threads

  1. How does this very simple code work?
    By Codeless in forum New To Java
    Replies: 1
    Last Post: 11-29-2010, 11:43 PM
  2. Simple code. Could you help pls..?
    By Iliyas in forum New To Java
    Replies: 8
    Last Post: 12-26-2008, 03:17 AM
  3. Simple code help
    By rednose in forum New To Java
    Replies: 11
    Last Post: 11-30-2008, 06:02 AM
  4. Please help me this is simple bit of code
    By BlitzAcez in forum New To Java
    Replies: 4
    Last Post: 11-27-2008, 05:52 AM
  5. simple code
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •