Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting into Java: French Verb Conjugation Program
#14
Hazzy Wrote:I saw it used somewhere, it might have been a C++ book. It loops forever. while (true) would have had the same effect.

Edit:
Google'd it.

I put it there so I could test multiple verbs without restarting the program.

Code:
Verb MyVerb = new Verb(infinitive, tense);
            
            for (int i = 0; i < 6; i++) { // <-- WAT
                ; // <-- WAT
            } // <-- WAT
            for (int i = 0; i < 6; i++) {
                System.out.println(MyVerb.getPronoun(i) + " "
                        + MyVerb.conjugate(i));
            }
            System.out.println(""); //spacer after each verb to make the output more readable
            }
    }

And for infinite loops that depend on user input, a do-while statement is strongly advised.
Reply


Messages In This Thread
Getting into Java: French Verb Conjugation Program - by Fiel - 2010-10-14, 01:02 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)