need help moving a program into classes
hello everyone
how is everything going?
i am a new user here and and was wondering if anyone could help me with a program that i am writing. i have it most of it writen its but need to put it into classes. i just started to learn java so this stuff is new to me
if anyone can help please let me know.
thank you
this is the basic overveiw of the program i am trying to write
:
i need Create an employee class with data members:
name, department number, employee number and salary
Derive a class student employee from the employee class.
student employee data members:
grade point average & accumulated hours
The input should include name, department number, employee number, salary, grade point average and accumulated hours.
In addition, after all the data has been entered, i need to sort student employees by name.
and Store the valid student employee records in an array of student employees
also, Store the invalid student employee records in an array of student employees.
what the program does
Reads in name, department number, employee number, salary, grade point average and accumulated hours.
Validate the values in a method and displays unique error messages.
Count the number of good records, bad records and total records.
Display the average of the salaries in the good records.
When the user has entered 5 records, display the records in the arrays sorted by name.
these
Ranges:
name 1 - 10 characters
department number valid range : 1 -10
employee number valid range : 1 - 100
salary valid range : 1.0 - 999.99
grade point range : 0.0 - 4.0
accumulated hours: equal to or greater than zero
i am helping out a freind that needs this program to work, i am having some trouble
i have this program working without the use of classes and sorts so if anyone can help and would like to see my code please let me know
any help would be apprecaited thank you
thank you again
1 Attachment(s)
Here is my implementation of your program using classes.
Attached is the whole project folder (you can import this in Eclipse)..
if you're not using eclipse then you can just compile the source. :D
Hope I answered a part of your dilemma. :D
Just send me email at my gmail account if you have questions.
[email protected]
1 Attachment(s)
Here is an update... Employee Demo using Swing
This is For those who want to study swing also. :D
I have updated the Project I attached... and here it is.
It's using Swing... basically it is still the same. no classes
have been removed I just added Two:
AppDemoGui - the gui but the process is still within AppDemo class
IncompleteDataException - an exception when the user tries to add incomplete information. so that AppDemo will be notified about the error :D
BTW... the listener for all the buttons is the AppDemo class.
The project can be run either using the GUI or the console that's why I didn't remove the other classes :D
Cell is still used since I haven't tried using LinkedList in java.util yet. :D. I just made one that is convenient for me. :D But you can have your own implementation.. the style I adopted from a code I downloaded from planet-source code.. so it all depends on how you want to code it. :D.. just make sure you understand and that the code works. :D
Invoke the class using the java interpreter:
to Run in Gui:
java AppDemo
to Run in Console same as before output:
java AppDemo console
As usual this project can be imported in eclipse. :)