I'm trying to run a check whether or not a user has entered the @gmail.com
suffix to their input. If not, then append it. I'm having a little difficulty because this loop seems to be written correctly to me. I'm at a loss. Anyone? I'm sure it's simple, I just can't see it.
String UN;
Scanner sc = new Scanner(System.in);
String suf = "@gmail.com";
boolean sufd;
// your code goes here
UN = sc.nextLine(); //
if(UN.length() >= 11){
sufd = UN.substring(UN.length()-11,UN.length()-1).equals("@gmail.com");
if(!sufd) {
UN += suf;
}
} else if(UN.length() < 11) {
UN += suf;
}
System.out.print(UN);