The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

need help urgently!!

Very stuck on a programming question!!

Data for a number of people is given as a string. The data for each person is given
by two fields, a forename and a surname separated from each other by a forward
slash character. The end of each person’s data is marked by a # character. The
following is an example of such a String:

George/Best#Eric/Cantona#Ryan/Giggs#Br…

Write and test a Java application containing a main method class called
ArrayOfStringsDemo and a class called Name.

Name is to have two fields, one for a forename and one for a surname, and should
include a constructor with formal arguments corresponding to the fields, an accessor
method for each field and a toString method.

In addition to the main method, ArrayOfStringsDemo should contain a static
method called findName which takes two arguments. The first argument is an array
of elements of type Name and the second argument is a Name. findName returns the
index of the element in the given array whose firstname and secondname are the
same as those of the Name given as the second argument. If a match is not found,
-1 is returned.
You main method should implement the following steps.
(a) Prompt for and read in an integer representing the number of firstname/secondname
pairs in a string to be input; store the input value in an int n.
(b) Prompt for and read in a String with the above format and containing n
firstname/secondname pairs.
(c) Construct an array of Names of size n called testArray.
(d) For each successive firstname/secondname in the input String, construct a
Name object and assign this to the next element in testArray.
(e) Use an appropriate selection of test Names to thoroughly test your findName
method.