Answer:
String initials = given.charAt(0) + "." + middle.charAt(0) + "." + family.charAt(0) + "." ;
Step-by-step explanation:
The code has been written in Java.
To get the first character of a String variable say, name, the syntax is:
name.charAt(0);
Zero(0) in the above expression indicated the position of the first character.
Therefore, to get the first character of the string given, we have
given.charAt(0).
To get the first character of the string middle, we have:
middle.charAt(0);
To get the first character of the string family, we have:
family.charAt(0);
Concatenating all of these first characters together and separating them by a period(.) we have;
given.charAt(0) + "." + middle.charAt(0) + "." + family.charAt(0) + "." ;
These will form a string which can be stored in a String variable, say 'initials', as follows;
String initials = given.charAt(0) + "." + middle.charAt(0) + "." + family.charAt(0) + "." ;
Hope this helps!