Results 1 to 3 of 3
  1. #1
    Evii0 is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default 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)

  2. #2
    Evii0 is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    what I forgot to say; at the end it's supposed to print out a list of possible exams that person could be in

  3. #3
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    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.

Similar Threads

  1. Excel: How to sort a range?
    By Chris_X in forum Java Servlet
    Replies: 9
    Last Post: 11-22-2010, 01:24 PM
  2. String index out of range: -1 Please Help
    By davetheant in forum New To Java
    Replies: 22
    Last Post: 09-11-2010, 12:32 AM
  3. pls help in understanding the range of byte
    By shivamskn in forum New To Java
    Replies: 2
    Last Post: 06-24-2010, 12:07 PM
  4. In-Range adder
    By filem_funk in forum New To Java
    Replies: 1
    Last Post: 11-27-2009, 01:06 AM
  5. Range within an Array
    By End in forum New To Java
    Replies: 6
    Last Post: 04-18-2009, 06:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •