package ch.ntb.inf.deep.testClasses;

public class T04Loops {
    public static void doWhile1() {
        int i = 0;
        do {
            i++;
        } while(i < 10);
        int j = i + 1; 
    }
    
	public static void doWhileIf1() {
		int j, i;
		boolean b, c;

		j = 0;
		i = -6; // 0: c TRUE, b FALSE ; - 6 b TRUE c FALSE

		do {
			j++;
			i = i + j;
			b = i < 10;
			c = j < 5;
		} while (b && c);

		if (b) {
			j = -1;
		} else {
			j = 1;
		}
	}

	public static int while1() {
		int i = 0;
		while(i < 10) {
			i++;
		}
		return i;
	}

    public static void whileTrue() {
    	int a = 10;
        while(true) {
        	int b = a + 1;
        }
    }

    public static void whileTrueBreak() {
    	int a = 10;
        while(true) {
        	int b = a + 1;
        	break;
        }
        int b = a;
    }

	public static int whileMultiCond() {
		int i = 0;
		while(i < 10 && i >= 0) {
			i++;
		}
		return i;
	}

}

@@ -988,14 +988,366 @@
  i;%0D%0A%09%7D%0D
+%0A%09%0D%0A%09public static void for1()%7B%0D%0A%09%09int a = 0;%0D%0A%09%09for(int i=0; i %3C 10; i++)%7B%0D%0A%09%09%09a++;%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%09%0D%0A%09public int forWhile(int x)%7B%0D%0A%09%09for(int i = 0; i %3C x; i++)%7B%0D%0A%09%09%09while(x %3E 4)%7B%0D%0A%09%09%09%09x--;%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09return x;%0D%0A%09%7D%0D%0A%09%0D%0A%09public void forIfWhile()%7B%0D%0A%09%09for(int i = 0; i %3C 100; i++)%7B%0D%0A%09%09%09if(i %3E 50)%7B%0D%0A%09%09%09%09while(i %3C 75)%7B%0D%0A%09%09%09%09%09i++;%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%7D%0D%0A%09%09%09%0D%0A%09%09%7D%0D%0A%09%7D%0D
 %0A%0D%0A%7D%0D%0A

add testmethods forWhile(int x) and forIfWhile()