CSC 172 - Introduction to Algorithms and Data Structures
Dr. R. M. Siegfried
Assignment #4 - Enhancing A Class of Names
Due Monday, February 17, 2014
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 them in the order
in which they should appear.
The previous assignment can be found here.
[Back to the Assignment Index]