Back to all lessons


Lesson 7

Point class

Task 0 (1p)

Create a loop printing sequence: 1, 3, 9, 27, 81, ..., 1594323.

Task 1 (2p)

Write a program that prints a pattern like that:


    + + + +                    
     * * * 
      + + 
       * 
                

Task 2 (1p)

Using only "+" operator create a program, that multiplies two variables. You can not use "*".

Task 3 (1p)

Rewrite the code below using for:

        
    int i = 23;
    while (i >= 0) {
        System.out.println(i);
        i--;
    }