Question: I need help understanding how to make this program in Java, while using the following conditions that are in the picture I provided. Such as
contains a list of students ha 2 Output the first name, and the last name initial, both in capital letter, to an output file output.txt: Be sure to test to see if you opened the input and output files before you use them. You are required to use file input and output class. Grading criteria also include good documentation, descriptive variable names, and adherence to the coding convention noted on pages! & 2 You will first create a name.txt file, and input the following 10 randomly generated names (you can choose the names: Lilliana Sheley Vincenza Teamer Theron Beckler Kacie Velazquez Ione Exum Mel Lade Fernando Boxx Leonila Discher Sophie Pospisil Verlene Knapik Your program will then read cach line, and find the initial for the person's first and last name, and output the first and last name to the file "output.txt". You output.txt should like the same: Lilliana, s Vincenza, I Theron, B Hints: -Use the Scanner and PrintWriter classes in order to read and print from/to files. - Use hasNextLine() in a while loop to check if there are more names to read in the file and each line with the next.ined) method. Use the following methods to manipulate the string: indexOfString str): Returns the index within this string of the first occurrence of the specified substring. substring(int beginIndex, int endindex): Returns a new string that is a substring of this string. to UpperCase Converts all of the characters in this String to upper case using the rules of the default locale. charAt(int index): Returns the char value at the specified index. The first name and the last name is separated by the space. Use the indexOf() method of the String class to find the index of the blank space, the initial of the last name is the next index after the space
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
