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: How to change 0 zeros to Integers in a do-while statement

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to change 0 zeros to Integers in a do-while statement

    Hi All,

    Noob here.

    How do i change the outcome to below? at the moment it is all 0? Please if you can add a brief explanation so i can clear some clouds in this area. thanks in advance.


    Competitor 1: 1 1 1 1 1
    ===============================================

    Competitor 2: 2 2 2 2 2
    ===============================================

    Competitor 3: 3 3 3 3 3
    ===============================================

    Competitor 4: 4 4 4 4 4
    ===============================================

    Competitor 5: 5 5 5 5 5
    ===============================================

    here's the code:
    case 2: System.out.println("Menu item 2");
    for(int i=1; i<MAX_COMPS;i++){
    System.out.print("Competitor " + i + ": ");
    for (int j=1;j<MAX_SCORES;j++)
    System.out.print(scores[i][j] + " ");
    System.out.println("");
    }


  2. #2
    Member
    Join Date
    Oct 2013
    Location
    Manila, Philippines
    Posts
    284
    My Mood
    Amused
    Thanks
    6
    Thanked 63 Times in 61 Posts

    Default Re: How to change 0 zeros to Integers in a do-while statement

    Hi! Welcome to the forum! Please read Announcements - What's Wrong With My Code? for guidlines.
    Please edit your code as what the above link says.

Similar Threads

  1. How do I create a if statement that accepts only Integers?
    By Mnelson in forum What's Wrong With My Code?
    Replies: 4
    Last Post: July 19th, 2012, 04:00 PM
  2. How Compare Integers using the if statement and && operator? Can it be done?
    By sethxhero7 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: January 31st, 2012, 02:48 AM
  3. [SOLVED] (Simple) How to use an if statement to respond to random integers
    By DusteroftheCentury in forum Loops & Control Statements
    Replies: 9
    Last Post: January 27th, 2012, 08:15 PM
  4. [SOLVED] Writing Integers to .txt File; Returning Random Characters Instead of Integers
    By verbicidalmaniac in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: March 8th, 2011, 08:42 PM
  5. [SOLVED] My smallest and largest integers will not change.
    By toiletsauce in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 1st, 2011, 06:50 PM