| | |
Need Help Urgently!
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2008
Posts: 1
Reputation:
Solved Threads: 0
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' : ???????
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' : ???????
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.
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
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 !!!
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.
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 !!!
![]() |
Similar Threads
- I need .NET basic interview questions urgently (C#)
- C++ Assignment NEED HELP URGENTLY (C++)
- is it possible to save a visual basic form in jpeg format??? pls help... urgently... (Visual Basic 4 / 5 / 6)
- Help Needed Urgently With Coding (Java)
- Preparing for an interview and need some questions answered (C)
Other Threads in the Java Forum
- Previous Thread: Create a countdown timer for a game in applet?
- Next Thread: Array String
| Thread Tools | Search this Thread |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception file fractal ftp game givemetehcodez graphics gridlayout gui helpwithhomework html ide image inetaddress input integer j2me japplet java javaprojects jme jmf jni jpanel jtextarea julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sql storm string support swing test threads time tree unlimited webservices windows






