[Solved]Java Program 1open Notepad Word Type Following 408888 201853 162621 126106 118038 102972 9 Q37126625
Java Program
1.Open notepad or word and type the following: 408888 201853162621 126106 118038 102972 92384 90218 80145 54525 49782 4392642883 Save the file as ”population.txt” DO NOT save the file in docor docx format, save in Plain Text format (extension txt). “2.Files and Array Lists” Create a class named FileAverage. In thisclass you will write a method that takes a String representing afile name as parameter, and returns an array list consisting of allintegers in that file. You may assume that the file consists only ofintegers. Create a method named readFile that takes a String namedfileName whose type is ArrayList. Since this method will read inputfrom a file, it must throw an exception. We will not learn aboutexceptions in this course. This lead to following method header: 1public static ArrayList readFile(String fileName) throwsFileNotFoundException In the body of the method we will write codethat does follwoing: • Create an empty arraylist of Integers. •Read each integer from the file and add it to the array list. •return the array list. Now, write another method named listAveragethat takes an array list of integers as parameter and returns theaverage of all integers of the list. By calling the method readFileand listAverage, output the average of all integers in the filepopulation.txt.
Expert Answer
Answer to Java Program 1.Open notepad or word and type the following: 408888 201853 162621 126106 118038 102972 92384 90218 80145 … . . .
OR

