Question: java please as well as extra credit ASSIGNMENT Assignment #10 - Enhancing a Class for a Name In the last assignment, we created a class
ASSIGNMENT Assignment \#10 - Enhancing a Class for a Name In the last assignment, we created a class called Name. In the last assignment, we created a class called Name. This time, we are going to add the following methods: - toString - which returns a String consisting of the name. - A copy constructor, which takes as its one parameter another object of class Name - precedes, which returns true if the object comes before the parameter Create a main program that reads in three names and prints the name that is first in standard alphabetical order (by last name; if the last name is the same by first name; if both match by initial). Extra credit: Create a program that reads in three names and prints them in the order in which they should appear. Hint: Write a method that takes all three names and returns the name that appears first, a method that takes all three names and returns the name that appears in last. The previous assignment can be found in Assignment #9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
