surfmuggle / Cubert

To become a jedi one must start as a novice
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Java Aufgabe CarryOn #34

Closed Dennis-V1 closed 3 years ago

Dennis-V1 commented 3 years ago

das hier ist mein Code den ich bisher habe. Der laeuft leider so nicht richtig:

import java.util.Scanner;

public class CarryOn {

public static void main(String[] args) 
{
    Scanner scanner = new Scanner(System.in);
    while(true) {
    System.out.println("Shall we carry on (enter yes,ye or y to continue and n to stop)?");
    String input = scanner.nextLine();
    if (input.equals("yes")  || (input.equals("ye") || (input.equals("y")) 
    {
        System.out.println("Shall we carry on?");
     } 
     else if (input.equals("n"))
     {
            System.out.println("stop");
     } // else
    } // while
} // method

}

Dennis-V1 commented 3 years ago

Carry on aufgabe

surfmuggle commented 3 years ago

import java.util.Scanner;

public class CarryOn {

public static void main(String[] args) 
{
    Scanner scanner = new Scanner(System.in);
    while(true)
    {
    System.out.println("Shall we carry on (enter yes,ye or y to continue and n to stop)?");
    String input = scanner.nextLine();
    if ( input.equals("yes")  || input.equals("ye") || input.equals("y")) 
    {
        System.out.println("Shall we carry on?");
     } 
     else if (input.equals("n"))
     {
            System.out.println("stop");
     } // else
    } // while
} // method

}

surfmuggle commented 3 years ago

This line has superfluous (