EU Flag  
 

    Assume that you are a member of the programming committee for implementing a method to print the new EU flag, which was decided on by the EU-commission after years of fighting, for when the new countries have joined. The surprising decision is given below:

       
               1         2         3         4
      1---5----0----5----0----5----0----5----0
      ????????????????????????????????????????
      ????????????????????????????????????????
      ??/= /= /= /= /=|  (    (    (    (  +??
      ??= /= /= /= /= |  (    (    (    ( + ??
      ?? /= /= /= /= /|  (    (    (    (+  ??  -5
      ??/= /= /= /= /=|  (    (    (    +)))??
      ??= /= /= /= /= |  (    (    (   +    ??
      ?? /= /= /= /= /|  (    (    (  +     ??
      ??/= /= /= /= /=|  (    (    ( +))))))??
      ??= /= /= /= /= |  (    (    (+       ??  -10
      ?? /= /= /= /= /|  (    (    +        ??
      ??/= /= /= /= /=|  (    (   +)))))))))??
      ??= /= /= /= /= |  (    (  +          ??
      ?? /= /= /= /= /|  (    ( +           ??
      ??/= /= /= /= /=|  (    (+))))))))))))??  -15
      ??= /= /= /= /= |  (    +             ??
      ??---------------  (   +              ??
      ??  (    (    (    (  +)))))))))))))))??
      ??  (    (    (    ( +                ??
      ??  (    (    (    (+                 ??  -20
      ??  (    (    (    +))))))))))))))))))??
      ??  (    (    (   +                   ??
      ??  (    (    (  +                    ??
      ??  (    (    ( +)))))))))))))))))))))??
      ??  (    (    (+                      ??  -25
      ??  (    (    +                       ??
      ??  (    (   +))))))))))))))))))))))))??
      ??  (    (  +                         ??
      ??  (    ( +                          ??
      ??  (    (+)))))))))))))))))))))))))))??  -30
      ??  (    +                            ??
      ??  (   +                             ??
      ??  (  +))))))))))))))))))))))))))))))??
      ??  ( +                               ??
      ??  (+                                ??  -35
      ??  +)))))))))))))))))))))))))))))))))??
      ?? +                                  ??
      ??+                                   ??
      ????????????????????????????????????????
      ????????????????????????????????????????  -40
       

      The method

      public char determineCharacter (int column, int row);

      needs implementation, so that it can be called from the nested loop

                 
      String outputLine; 
      for (int row = 1; row <= 40; row++){
           outputLine = "";
           for (int column = 1; column <= 40; column++){
      outputLine = outputLine+determineCharacter (column, row);
      } System.out.println (outputLine);
      }
Last change::