Basic Java program help

Discussion in 'OT Technology' started by usd2020, Sep 23, 2005.

  1. usd2020

    usd2020 New Member

    Joined:
    May 16, 2004
    Messages:
    101
    Likes Received:
    0
    Location:
    Belmont, NC
    Hello everyone, i'm currently enrolled in an ITCS course at college and we're mainly working with Java.

    I have an assignment where i have to have the user input three names (can't use dialouge boxes) and then have the program display those names in ascending order. I've looked over the examples listed in my course's textbook and I don't really understand how i'm supposed to do this. The only way I can think of to do it is to use nested if/else statements to compare the names input by the user but again i'm not sure how to do that with characters other than numbers.

    The program also has to take into account the case of the names when sorting them and i have no idea how to do that.

    It seems to me that I'm overthinking this assignment and that the solution is really simple, but I'm not sure what it is. If anyone could help me out or point me in the right direction I would greatly appreciate it.
     
  2. Frequency

    Frequency New Member

    Joined:
    Dec 30, 2004
    Messages:
    7,504
    Likes Received:
    0
    Location:
    PA
    google - bubble sort
     
  3. Corp

    Corp OT Supporter

    Joined:
    Sep 11, 2003
    Messages:
    28,201
    Likes Received:
    0
    Location:
    Providence, RI
  4. usd2020

    usd2020 New Member

    Joined:
    May 16, 2004
    Messages:
    101
    Likes Received:
    0
    Location:
    Belmont, NC
    Thanks for the replies.

    I looked into this bubble sorting and I'm not sure if that's the direction I should go in. In my text book it doesn't even mention it for a couple more chapters and in this class we haven't even touched on arrays yet. This leads me to believe that there's another way to do this other than using bubble sorting. I will try to get this bubble sorting to work but at the same time I am still looking through the book and online to find another possible solution.

    Again, thank you for the responses.
     

Share This Page