Results 1 to 4 of 4

Thread: BLUEJ Program

  1. #1
    threlot is offline Member
    Join Date
    Oct 2012
    Posts
    11
    Rep Power
    0

    Post BLUEJ Program

    Hello, I need help on my BlueJ homework.

    Complete this application with the following specifications:
    1.Input the words into a single String variable as a comma-delimited list using a showInputDialog (or you may use a Scanner object).
    2.The words from the list must tokenized by the split() method of type String and assigned to a String array prior to sorting.
    3.Examples of sorting algorithms are provided in Chapter 19; do not use the sort method of the Array class (or any other Java library sorting Class) to sort the array (except as noted below).
    4.The alphabetizing is case insensitive, so use the appropriate String method for comparing.
    5.Output the list with each word on a separate line into a showMessageDialog (or you may use the print() and/or println() methods).

    What i have so far is:

    public class Strings
    {
    public static void main(String[] args)
    {
    Scanner reader = new Scanner(System.in);

    String s1 = new String("Dog, Mouse, Cat, Pig, Monkey");

    String[] t1 = s1.split(",");

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

    Default Re: BLUEJ Program

    What you don't have is a specific question. Please post your full code, any error messages and ask a specific question. "I don't know what to do" is neither specific nor a question.

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

    Default Re: BLUEJ Program

    BLUEJ Program Help

    Duplicate post

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,730
    Blog Entries
    7
    Rep Power
    21

    Default Re: BLUEJ Program

    You're not using your Scanner object (as stated in point #1); b.t.w. spaces in that String (around the commas) are real show stoppers; better split around "\\s*,\\s*".

    kind regards,

    Jos

    ps. I thought BlueJ was just a Java editor/ide; I don't call my C or C++ programs "vi programs" either ...
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 2
    Last Post: 02-08-2013, 01:46 PM
  2. BlueJ program
    By ukgate13 in forum New To Java
    Replies: 1
    Last Post: 11-23-2012, 06:12 PM
  3. BlueJ IDE
    By jcbmack in forum New To Java
    Replies: 9
    Last Post: 08-08-2012, 08:26 AM
  4. BlueJ - UML
    By Nghi97 in forum New To Java
    Replies: 5
    Last Post: 11-28-2011, 12:03 PM
  5. Simple Java BlueJ Converting Program
    By Mahoo in forum New To Java
    Replies: 3
    Last Post: 08-04-2010, 06:28 AM

Tags for this Thread

Posting Permissions

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