Search:

Type: Posts; User: ///M Dood

Search: Search took 0.06 seconds.

  1. Replies
    11
    Views
    1,083

    [SOLVED] Re: Continue and break statements

    Here's what i got to work:



    public class Test
    {
    public static void main(String[] args) {
    int i = 1;

    while(true)
  2. Replies
    11
    Views
    1,083

    [SOLVED] Re: Continue and break statements

    Yes, prior instructions stated that i be initialized to 1. I'm just leaving it for the moment, the whole rest of the assignment is a freaking mess as well.
  3. Replies
    11
    Views
    1,083

    [SOLVED] Re: Continue and break statements

    OK, i'm really close i think. I got the code to compile and display the desired output, only problem is that in the assignment it requires me to declare a variable of type int, name it i and set it...
  4. Replies
    11
    Views
    1,083

    [SOLVED] Re: Continue and break statements

    OK, I'll give understanding your post a solid effort before i report back. Just scratching my head how a while(true) statement would be formatted without the if-else statements. I am still quite new,...
  5. Replies
    11
    Views
    1,083

    [SOLVED] Re: Continue and break statements

    Well, after the println, it's what worked in the final while(true) loop. I tried rearranging everything in the loop like this:


    while(true)
    {
    System.out.println(i);
    if (i > 5) break;
    else...
  6. Replies
    11
    Views
    1,083

    [SOLVED] Re: Continue and break statements

    "Using a while(true) statement, loop over Year i from 1 through 5, EXCEPT i = 3. Use a break statement to exit the loop as appropriate. When i = 3, it should skip the calculations and go the next...
  7. Replies
    11
    Views
    1,083

    [SOLVED] Continue and break statements

    Code then description of problem:


    class Weather
    {
    public static void main(String[] args)
    {
    // declare variables
    int i = 1; // represents year
    double temp = 0.0;
Results 1 to 7 of 7