You get the NullPointerException
when something other than y
is entered for the relationship question.
if (choice.equals("y"))
relationship = "In a relationship.";
if (choice.equals("y"))
relationship = "Single.";
A quick fix is to set a default value for the field relationship
if ("y".equals(choice)) {
relationship = "In a relationship.";
else {
relationship = "Single.";
}