Finish writing the Name class that encapsulates the first, middle, and last name within Name objects. The first name, middle name, and last name variable will be private instance variables of the Name class. The Name class has the following methods: +Name), +Name(String,String,String) +getFirstName:String +getMiddleName(String +getLastName(String //Constructor that initializes a new Name object with random first, middle, and last names. #/Constructor that initializes a new Name object with the values of the arguments, where the order of the arguments is first name, middle name, last name. Returns the first name //Returns the middle name Returns the last name +setFirstName(String):void, #Sets the first name to the argument value +setMiddleName(String):void, //Sets the middle name to the argument value +setLastName(String):void, //Sets the last name to the argument value +changeNameTo(String, String, String)void, //changes the first, middle and last names to the argument values +mergeNames (Name):void, //Concatenates the last name of the argument Name object onto the end of the calling object's last name, with a hyphen separating them. Both object's last names are changed to this merged last name. Example: if object one's last name were Jones, and object two's last name were Washington, and the method was called by object one as objetOne.mergeNames (objectTwo) Their last names would change to Jones-Washington. +getFullName(String. //Returns a String in the format lastName, firstName, middleName //Note the use of commas. //Returns a String in the format firstName middleName lastName //Note the lack of commas. //Returns true when the first, middle, and last names of the argument object match the calling object. +toString0 String. +equals(Name):boolean. Pay attention to the methods equals() and toString() as these methods are public methods of the parent class (called the Object class) that the Name class is generated from. Note that these methods override and overload them. The UnitTestDemo program is provided as an Eclipse zipped project file and consists of a NameTest class and a Name class. The Name class is incomplete and the NameTest currently only unit tests the methods that are currently in the Name class. You will need to import this project into Eclipse and alter both classes. Your assignment is to complete the Name class and add unit testing for each of the new methods you add. You will also need to correct the equals and the toString method, and their respective testing methods. You must include a UML for the Name class. The easiest way to do this is to use a Table in MS Word and then adding that file to the Eclipse proiect. Just drag and drop the file from the file window to the Eclipse proiect.
Finish writing the Name class that encapsulates the first, middle, and last name within Name objects. The first name, middle name, and last name variable will be private instance variables of the Name class. The Name class has the following methods: +Name), +Name(String,String,String) +getFirstName:String +getMiddleName(String +getLastName(String //Constructor that initializes a new Name object with random first, middle, and last names. #/Constructor that initializes a new Name object with the values of the arguments, where the order of the arguments is first name, middle name, last name. Returns the first name //Returns the middle name Returns the last name +setFirstName(String):void, #Sets the first name to the argument value +setMiddleName(String):void, //Sets the middle name to the argument value +setLastName(String):void, //Sets the last name to the argument value +changeNameTo(String, String, String)void, //changes the first, middle and last names to the argument values +mergeNames (Name):void, //Concatenates the last name of the argument Name object onto the end of the calling object's last name, with a hyphen separating them. Both object's last names are changed to this merged last name. Example: if object one's last name were Jones, and object two's last name were Washington, and the method was called by object one as objetOne.mergeNames (objectTwo) Their last names would change to Jones-Washington. +getFullName(String. //Returns a String in the format lastName, firstName, middleName //Note the use of commas. //Returns a String in the format firstName middleName lastName //Note the lack of commas. //Returns true when the first, middle, and last names of the argument object match the calling object. +toString0 String. +equals(Name):boolean. Pay attention to the methods equals() and toString() as these methods are public methods of the parent class (called the Object class) that the Name class is generated from. Note that these methods override and overload them. The UnitTestDemo program is provided as an Eclipse zipped project file and consists of a NameTest class and a Name class. The Name class is incomplete and the NameTest currently only unit tests the methods that are currently in the Name class. You will need to import this project into Eclipse and alter both classes. Your assignment is to complete the Name class and add unit testing for each of the new methods you add. You will also need to correct the equals and the toString method, and their respective testing methods. You must include a UML for the Name class. The easiest way to do this is to use a Table in MS Word and then adding that file to the Eclipse proiect. Just drag and drop the file from the file window to the Eclipse proiect.
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 5RQ
Related questions
Question
I need this in Java please ASAP!
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,