name in a range of names
I'm supposed to be writing a program that asks the user for their family name and a date and it searches a file with an exam timetable* in it for the certain date and checks to see if the name is within the range of names.
I know how to get all the exams on that day, but not how to check if the name falls in the range of names.
*note: the timetable has 6 columns, course, room, date, No. of students, and the last two are the range of names (eg alex Hicks means everyone with family names between those two names)
what I forgot to say; at the end it's supposed to print out a list of possible exams that person could be in
Use the compareTo method. Compare target name with first name. Compare target name with second name. From the results you can tell if the target name falls between the other two names.