Need Help Urgently!

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2008
Posts: 1
Reputation: -Observer- is an unknown quantity at this point 
Solved Threads: 0
-Observer- -Observer- is offline Offline
Newbie Poster

Need Help Urgently!

 
0
  #1
Dec 3rd, 2008
Hi,

I'm new to Java and I need help with the following if someone can help me:

Write a program named Personnel that maintains salary information for the employees of a company. The program should display a text based menu, giving the user a choice of selecting a command.

The commands that the program should support are: n (create new employee by pressing the n button), l (list all employees), p (compute all paychecks), r (raise wages), and q (exit the
menu).

The n command creates a new employee and prompts the user for the name of the employee, and whether the employee is an hourly paid, or has an annual salary. If the user selects to create
an hourly paid employee, he/should be prompted for the hourly rate, otherwise he/should be prompted for the annual salary of the employee.

The p command calculates and displays on the screen the amount that it should be paid to each individual employee who already exists in the system. Assuming that hourly paid employees have been created, the p command should ask the user for the number of hours that each individual hourly paid employee has worked for.

The r command should prompt the user for a percentage rate. All salaries (annual and hourly) should be increased by this rate.

Additionally, the user should be able to display all the employees with an annual salary in ascending order, according to their salaries. I.e. the employee with the smallest salary should
be displayed first, the employee with the second smallest salary should be displayed next, etc
.
The program should implement the classes Employee (abstract class), HourlyEmployee, SalariedEmployee with appropriate methods.

Implement a test class which creates instances of all the implemented classes and tests their functionality.
---------------------

I've done a text based menu displaying the above options, but what do I put in the switch case for the menu for the different cases?

case 'N' : ???????
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,506
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 521
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Need Help Urgently!

 
0
  #2
Dec 3rd, 2008
Seems to me you would put the code to carry out the operations you've been instructed to perform for each of those menu options.

Perhaps if you can post some code and ask more specific questions, someone here can help you out. They won't write it for you though.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 1,711
Reputation: javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all javaAddict is a name known to all 
Solved Threads: 229
Featured Poster
javaAddict's Avatar
javaAddict javaAddict is offline Offline
Posting Virtuoso

Re: Need Help Urgently!

 
0
  #3
Dec 3rd, 2008
You will create separate classes for your employees and they will have the attributes that are described in your assignment (name, hourly paid, ... ). Then the user eneters 'N' you will read the input specified, create a new object 'employee' and add to a list of employees (Use the java.util.Vector or the java.util.ArrayList class)

You will have methods that take as an argument the above Vector with employees and calculate what it is asked.
Check out my New Bike at my Public Profile at the "About Me" tab
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: Need Help Urgently!

 
0
  #4
Dec 4th, 2008
hmm... sounds like an assignment to me, show us some code which asserts us about the work done by you and as mentioned above ask specific questions where you might get stuck up, then we may be able to assist you further.
Last edited by verruckt24; Dec 4th, 2008 at 5:59 am.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: Need Help Urgently!

 
1
  #5
Dec 4th, 2008
Also to get you started on it...when working with a OO langauge always break down the problem domain into classes and methods.
You have most of it done since you have been given classes too. Now you can identify the individual methods that should be put into each class and write your code.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC