Don't use == to compare the contents of strings, use equals() instead.



if (sc.nextLine().equals("U"))


The thing is that == compares the values of variables or other expressions. This is...