rendered paste bodyimport java.util.Scanner;public class UnixAccount {/** * The main method. * * @param args the command line arguments */ public static void main( String args[] ) { String str1; // The string entered by the user String output; String firstName; String middleName; String lastName; String phoneNumber; int indexOfFirst; int indexOfMiddle; int indexOfLast; int indexOfPhone; Scanner input = new Scanner( System.in ); // Read in the strings System.out.print( "Enter First Name, Middle Name, Last Name, and Phone Number: " ); str1 = input.nextLine(); System.out.println(); indexOfFirst = str1.indexOf(' '); indexOfMiddle = str1.indexOf(' ', indexOfFirst + 1); indexOfLast = str1.indexOf(' ', indexOfMiddle + 1); indexOfPhone = str1.indexOf(' ', indexOfLast + 1);/* System.out.println("1: " + indexOfFirst); System.out.println("2: " + indexOfMiddle); System.out.println("3: " + indexOfLast); System.out.println("4: " + indexOfPhone); System.out.println();*/ firstName = str1.substring(0, indexOfFirst); middleName = str1.substring(indexOfFirst + 1, indexOfMiddle); lastName = str1.substring(indexOfMiddle + 1, indexOfLast); phoneNumber = str1.substring(indexOfLast + 1 ); firstName = firstName.toLowerCase(); middleName = middleName.toLowerCase(); lastName = lastName.toLowerCase(); phoneNumber = phoneNumber.substring(phoneNumber.length() - 4); /* System.out.println("first: " + firstName); System.out.println("mid: " + middleName); System.out.println("last: " + lastName); System.out.println("phone: " + phoneNumber);*/ firstName = firstName.substring(0,1); middleName = middleName.substring(0,1); lastName = lastName.substring(0,1); output = firstName + middleName + lastName + phoneNumber; // Display the results System.out.println(output); }}