I'm working on a code on compatibility and it seems that after I ask and answer the first question, the program just stops, I have no clue why it doesn't go on to ask the next question, can somebody help my figure this out, thanks, oh here is my code.
This is what it says on the bottom of my code after I run it and answer Y:
----jGRASP exec: java Compatibility
Do you either play or watch football? (Y/N) Y
Do you like going to the movies? (Y/N) Exception in thread "main" java.lang.NullPointerException
at Compatibility.main(Compatibility.java:33)
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
Here is my code:
import java.util.Scanner;
public class Compatibility {
public static void main (String [] args){
Scanner boysScanner = new Scanner(System.in);
//input variables
char reply1;
char reply2;
char reply3;
char reply4;
char reply5;
char reply6;
//display questions
System.out.print("Do you either play or watch football? (Y/N) ");
reply1 = boysScanner.findInLine(".").charAt(0);
System.out.print("Do you like going to the movies? (Y/N) ");
reply2 = boysScanner.findInLine(".").charAt(0);
System.out.print("Do you like education? (Y/N) ");
reply3 = boysScanner.findInLine(".").charAt(0);
System.out.print("Do you watch football? (Y/N) ");
reply4 = boysScanner.findInLine(".").charAt(0);
System.out.print("Do you like watching movies? (Y/N) ");
reply5 = boysScanner.findInLine(".").charAt(0);
System.out.print("Do you really like college? (Y/N) ");
reply6 = boysScanner.findInLine(".").charAt(0);
//determine by pairing
if (reply1 == reply4 && reply2 == reply5 && reply3 == reply6) {
System.out.println("You two are great for each other.");
}
if (reply1 != reply4 && reply2 != reply5 && reply4 != reply6) {
System.out.println("You two better stay away from each other");
}
if (reply1 != reply4 && reply2 == reply5 && reply3 == reply6) {
System.out.println("You two are somewhat good for each other.");
}
if (reply1 != reply4 && reply2 != reply5 && reply4 == reply6) {
System.out.println("You two better talk somemore.");
}
if (reply1 == reply4 && reply2 != reply5 && reply3 != reply6) {
System.out.println("You two better talk somemore.");
}
if (reply1 == reply4 && reply2 == reply5 && reply4 != reply6) {
System.out.println("You two are somewhat good for each other");
}
if (reply1 == reply4 && reply2 != reply5 && reply4 == reply6) {
System.out.println("You two are somewhat good for each other");
}
}
}