Welcome to the Java Programming Forums


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.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: java program with array's....need help!!

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java program with array's....need help!!

    What I need to do is create an array of 1001 numbers and have the user enter as many positive numbers up to 1001 numbers into the program and terminate the array with a 0 or negative number. In this example, the user entered 19 13 7 21 11 9 15 17 -1. Then I need to have the program ask the user to enter 2 of the numbers that appeared/or didn't in the list they originally entered and have the program (For example 13 and 9) and print out these three things-

    1) The 2 additional numbers appear in the original list in the same order (not necessarily consecutive).
    2)The 2 additional numbers appear in the original list, but not in the same order ( and, again, not necessarily consecutive).
    3)These 2 additional numbers do not appear together in the original list (although one of them might).

    For example to see what I am talking about:

    1) That pair (13 and 9) could be found, in that order, in the following list:
    19 13 7 21 11 9 15 17
    2) That pair (9 and 13) could be found, in that order, in the following list:
    19 13 7 21 11 9 15 17
    3) That (8 and 9) could not be found, at all, in the following list:
    19 13 7 21 11 9 15 17


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: java program with array's....need help!!

    What have you tried so far? Please post specific questions about issues you're having rather than dumping your assignment problem statement.

Similar Threads

  1. java program help
    By lolalala in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 24th, 2010, 06:42 PM
  2. Help with this java program
    By Nemphiz in forum Object Oriented Programming
    Replies: 3
    Last Post: April 13th, 2010, 04:09 AM
  3. How do you add GUI to this java program?
    By leyla in forum AWT / Java Swing
    Replies: 1
    Last Post: October 18th, 2009, 02:32 PM
  4. Convert Java Program to Java ME code
    By rinchan11 in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: October 5th, 2009, 11:18 PM
  5. Java Program Help
    By javakid93 in forum Java Theory & Questions
    Replies: 6
    Last Post: July 27th, 2009, 12:03 PM