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.

Page 2 of 2 FirstFirst 12
Results 26 to 29 of 29

Thread: While loop to perform multiple steps Please help assignment due in 12 hours!!

  1. #26
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    The newline character output by the println() method will make the next printed String go on the next line. Use the print() method to have the next print out go on the same line.
    If you don't understand my answer, don't ignore it, ask a question.

  2. #27
    Member
    Join Date
    Jan 2014
    Location
    New Jersey
    Posts
    48
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    Yes I am familiar with \n however that is not what I was suggesting. I think because my output is in a loop it prints everything rather then just one statement and then the multiple outputs im looking for. It keeps printing the same statement and then the output. I will post my output here in a second, maybe that will help what im trying to explain.

    Quote Originally Posted by Norm View Post
    The newline character output by the println() method will make the next printed String go on the next line. Use the print() method to have the next print out go on the same line.

  3. #28
    Member
    Join Date
    Jan 2014
    Location
    New Jersey
    Posts
    48
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: While loop to perform multiple steps Please help assignment due in 12 hours!!


  4. #29
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    Please copy the output and paste it here. Also post what you want it to look like.

    It keeps printing the same statement
    Look at the pseudo code in post#18 where I suggested that the reports be printed AFTER the loop had exited.
    If the println()s are inside the loop, they will print something every time the loop goes around.
    If you don't understand my answer, don't ignore it, ask a question.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. How to use a while loop to perform input validation?
    By namenamename in forum Java Theory & Questions
    Replies: 11
    Last Post: October 5th, 2013, 07:24 AM
  2. Replies: 1
    Last Post: December 5th, 2012, 10:58 PM
  3. [SOLVED] PLZ HELP! Somethng wrong with code, assignment due today! Print if multiple of...
    By Rstuart970 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 16th, 2012, 02:35 AM
  4. FractionCalculator StringTokenizer with parsing DUE IN 4 HOURS
    By DUE IN 4 HOURS in forum What's Wrong With My Code?
    Replies: 27
    Last Post: November 3rd, 2011, 08:15 AM
  5. Need help on an Assignment but its due tomorrow!
    By Mob31 in forum Paid Java Projects
    Replies: 1
    Last Post: March 2nd, 2011, 06:54 AM