Hello there I want to make a quiz app and so far I've done this.
import java.util.Scanner;
public class Brotcrunsher {
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
System.out.println ("Hallo");
System.out.println ("Welcome to the test");
System.out.println ("If you are the admin of the test and would like to edit it please type the password now");
System.out.println ("Otherwhise please say 'begin' to start");
String c = scan.nextLine();
if (c.equals ("edit")) {
System.out.println ("Editor mode coming soon, please edit via code");
}
else {
if (c.equals ("begin")) {
} // end of if
System.out.println ("A flag has more then 1 color right?");
String a = scan.nextLine();
if (a.equals("ja")) {
System.out.println ("You arent dumb, nice.");
System.out.println ("What is 352 + 223");
int b = scan.nextInt();
if (b == 575) {
System.out.println ("That is correct nice");
System.out.println ("You passed the basic questions, going to be tricky now");
System.out.println ("What was the date when Donald Trump became president");
String g = scan.nextLine();
System.out.println ("A = 19.01 B = 20.01 C = 21.01 D= 22.01");
if (g.equals ("B")){
System.out.println ("You are right, lets move on.");
} // end of if
else {
System.out.println ("That is wrong. Better luck next time");
} // end of if-else
}
else {
System.out.println("That isn't right, you failed.");
System.out.println ("If you'd like to repeat the test, go ahead and do so");
}
}
else {
System.out.println ("You arentn a genie");
}
}
}
}
So my question is where do I need to place the String g = scan.NextLine to get it working? I dont get any compiling error just the console exit's. I tried placing it at the beggining in the IF statement and on some other positions but it just stoppped. Please help.