Guten Tag, ich bin noch Anfänger im programmieren mit Java Eclipse und hoffe ihr könnt mir helfen. Ich will ein Java Eclipse -Programm zur Übung entwickeln , das zu folgendem Bild passt, also für die gleichen Eingaben die gleiche Ausgabe erzeugen. Bei meinem Code tritt eine Fehlermeldung auf, diese habe ich im code //kommentiert. Ich weiß nicht, wie ich weiter machen muss und wäre dankbar für jeden Tipp und jede Hilfe.
Mein Code den ich zusammen bekommen hab :
Mein Code den ich zusammen bekommen hab :
Java:
public class Programmlaufbeispiel{
public static void main (String[] args) {
System.out.println("Auswahl:");
System.out.println(" 1:1x1");
System.out.println(" p:Potenz");
System.out.println(" e:Ende");
Auswahl(0);
}
// Eingabeaufforderung Auswahl
public static void Auswahl (int i) {
double k = IO.readDouble("Auswahl 1, p, e : ");
if (k==1);
System.out.println("1x1 Tabelle berechnen");
einlesen();
}
public static void einlesen () {
int x = IO.readInt("Startzahl:");
int y= IO.readInt("Endzahl:");
while(x<=y) // äußere Schleife
{
y = 10;
while(y <= 20) // innere Schleife
{
//fehlermeldung warum?
System.out.print( "%dx%d = %d%n", x, y, x*y);
y++;
for(int b = IO.readInt("Startzahl:"); b <= IO.readInt("Endzahl:"); b++){
System.out.print(x+"\t");
}
System.out.print("\n");
for(int c = IO.readInt("Endzahl:"); c<= IO.readInt("Startzahl:"); c++){
System.out.println(y+"\t");
}
for(int s = IO.readInt("Startzahl:"); s<= IO.readInt("Endzahl:"); s++){
int z= IO.readInt("Startzahl:")*s;
System.out.print (z+"\t");
}
}
} }}