Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please follow the steps to complete this guided assignment: 1. Write a class Person.java, that has the following fields: name. The name field references a

image text in transcribed

image text in transcribed

Please follow the steps to complete this guided assignment: 1. Write a class Person.java, that has the following fields: name. The name field references a String object that holds the person's name. idNumber- The idNumber is an integer that holds the employee ID number. department. The department field references a String object that holds the name of the department where the employee works. 2. The class should have the following constructors: A constructor that accepts the listed values as arguments and assigns them to the appropriate fields as the following, employee's name, employee's ID number, and department. A constructor that accepts the listed values as arguments and assigns them to the appropriate fields as the following, employee's name and ID number. The department field should be assigned an empty string (*). A no-arg constructor that assigns empty strings ('') to the name, as well as department, and to the idNumber field. 3. Write appropriate mutator methods that store values in these fields. 4. Write accessor methods that return the values of the fields. 5. Write a toString() method that returns a String containing all the information about the person written on separate lines. 6. Once the Person class is written, create a separate program that creates three Person objects, instantiated with each of the constructors. 7. Display the three objects using toString method once they were created 8. For the objects that are created with constructors that have empty values, and zero, use mutator methods to change the values according to the following data: ID Number Department Jimmy Dean 23123 Sales Jane Young 32421 Marketing 54231 9. Display the tree objects after you update their values. 10. Download the template file, Person.txt, and save it as Person.java 11. Download the template file, PersonDriver.txt and save it as PersonDriver.java 12. Go through the files and identify the tasks you have to fulfill, which are clearly marked throughout the file. Complete all the required tasks. Name Ella Jones IT 13. If all the required methods are implemented properly, the driver program should generate outputs similar to the following: The initial information of the persons is: Name: ID number: 0 Department: Name: Jane Young ID number: 32421 Department: Name: Ella Jones ID number: 54231 Department: IT New information about the persons is: Name: Jimmy Dean ID number: 23123 Department: Sales Name: Jane Young ID number: 32421 Department: Marketing Name: Ella Jones ID number: 54231 Department: IT Press any key to continue . . . 14. Include the following items in the same Word file for the final submission: Your completed code in Person.java and PersonDriver.java At least one screenshot of the running output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions