Die Aufgabenstellung ist im Anhang ich schaffe es leider nicht, dass das Rechteck aufgefüllt wird.
Hat jemand eine Idee ?
Hier ist mein Code :
Hat jemand eine Idee ?
Hier ist mein Code :
Java:
//Aufgabe 4c
Scanner sc = new Scanner(System.in) ;
int breite ;
int hoehe ;
System.out.println("Breite?");
breite = sc.nextInt();
System.out.println("Höhe?");
hoehe = sc.nextInt() ;
for (int i =0;i<=breite ;i++ ) {
System.out.print("*");
} // end of for
for (int i=0;i<=hoehe ;i++ ) {
System.out.print("*");
System.out.println("*");
} // end of for
} // end of main