Search:

Type: Posts; User: Norm

Search: Search took 0.16 seconds.

  1. 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.


    Look at the pseudo code in post#18 where I suggested that the reports be printed AFTER the loop had exited.
    If...
  2. 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.
  3. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    If the separate tests are related, then they could be tied together. Like even vs odd number: if not even then must be odd.

    The comments in the code should say what the code is doing:
    //Part D...
  4. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    Just use one loop that goes from start to end and has inside of the loop the tests, etc

    See post#18
  5. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    Merge the code you have written in post#17 (the if statement for even numbers etc) with that in post#13

    See the pseudo code in post#18.
  6. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    If there is a loop that goes from the first to the last number, there could be more than one section of code in that loop that used the sequence of numbers used in the loop.

    begin loop from start...
  7. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    Parts of the code could be used for that: the loop that goes from one number to the other.
    What parts of Part C) are you having problems with? Make a list of the steps needed to do it.
  8. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    Glad you are making progress. As dicdic said, do it one step at a time.
  9. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    You can initialize them those variables with those values on the same lines when you define them just like you did with the variable: temp.
  10. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    The curly braces are very important to organize the code and ensure proper execution.


    What values should those two variables have? Where do those values come from? Is the Scanner class object:...
  11. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    You got part of it. There should be {}s for the loops and if statements
  12. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    You need to update the code by adding the {}s and indentations to make the code readable.
  13. Re: While loop to perform multiple steps Please help assignment due in 12 hours!!

    One problem I see is that statements in the loops and the if statement are not enclosed in {}s. That makes the code harder to read and understand and dangerous to change.

    Also nested statements...
Results 1 to 13 of 13