Answer:
public static String appendIfMissing(String s, String e){
if(!s.endsWith(e))
return s+e;
return s;
}
Explanation:
Create a method called appendIfMissing takes two strings, s and e
Inside the method, check if s ends with e - using endsWith method. If it is, append the to s and return the new string. Otherwise, return only the s
*string1.endsWith(string2) method checks if the string1 ends with string2 and returns either true or false.