Aufgabe 2                                                 Zurück

 

 

a)

 

public class Blatt2_Sterne_A  {

  public static void main (String[] args)  {

 

    for (int a = 0;a <= 10;a = a+1 ) {

      System.out.println("********************");

    }

 

 

  }

} 

 

b)

 

public class Blatt2_Sterne_B  {

  public static void main (String[] args)  {

 

    for (int a = 0;a <= 10;a = a+1 ) {

      for (int b = 0; b <= 20 ;b = b+1 ) {

        System.out.println("*");

      }

    } 

  }

} 

 

c)

 

 

    int a;

    int b;

    int aa;

    int bb;

   

    System.out.println("Geben sie die Breite und die Höhe des Rechtecks an!" );

    aa = Kon.readInt("Höhe: ");

    bb = Kon.readInt("Breite: ");

   

   

    for ( a = 0; a <= aa ; a = a+1 ) {

      for ( b = 0; b <= bb ; b = b+1 ) {

        System.out.print("*");

       

      } 

        System.out.println(" ");   

    } 

  }

}