Question: (JAVA) please help! Define a new class Employee where one object of class Employee represents the information about one Employee. Each Employee object will have:
(JAVA) please help!
Define a new class Employee where one object of class Employee represents the information about one Employee. Each Employee object will have:
private field for first name
private field for last name
private field for social security number
private field for salary
constructor method with a parameter for the initial value of each private field
constructor method with no parameters
getter and setter methods for each of the private fields
toString() method to return the object's data in a String
giveRaise() method that takes a float "percentRaise" as parameter and doesn't return anything. When you call this method and send it a "percentRaise", this method adds "percentRaise" percent of the current salary to the salary field of the object that calls it, thus giving that Employee a raise in salary.
Write and test each method one at a time. Make sure that all fields and methods work as expected before proceeding to the next one. The program that you submit to me must:
- consist of two source code files
- Include a main() that (in one run) prove that all methods in class Employee work correctly. Because this main() might be long, you do not have to adhere to Program Guideline #12.
- Include all documentation that is required in Program Guideline #3 from the Week 6 Module.
- Paste a copy of the console (after your program runs) to the bottom of one of the source code files.
Program Guideline #3 You must write a clear, concise comment at the top of every program telling WHAT the program does, not how it does it. If your program is actually a definition of a class that will have objects made from it, you must write a comment that says what one object of the class represents. This comment will start with the words "One object of this class represents...". Finally, you must write a comment for every method telling what that method does with the object and with its parameters, whether it changes the object or the parameters, and whether any user input or output is done in the method. Program Guideline #12 No method may be longer than 30 lines. If you find yourself writing such a long method definition, check the comment for that method. It probably contains the word "and" in it, indicating where to break this method up into separate methods.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
