@@ -0,0 +1,2266 @@
+import java.io.*;%0Aimport java.util.ArrayList;%0Aimport java.util.Random;%0A%0A/**%0A * Created with IntelliJ IDEA.%0A * User: pylkevych%0A * Date: 9/8/14%0A * Time: 11:11 AM%0A * To change this template use File %7C Settings %7C File Templates.%0A */%0Apublic class WriteReadFile %7B%0A    public static void main(String%5B%5D args) %7B%0A        WriteReadFile wrf = new WriteReadFile();%0A        wrf.writeToFile();%0A        String fileName = %22myFile.txt%22;%0A        wrf.readFromFile(fileName);%0A    %7D%0A%0A    private void writeToFile() %7B%0A        try %7B%0A            Random rand = new Random();%0A            int randomNum;%0A            int min = 100;%0A            int max = 999;%0A            File file = new File(%22myFile.txt%22);%0A            FileWriter writer = new FileWriter(file);%0A            for (int i = 0; i %3C 100; i++) %7B%0A                randomNum = rand.nextInt((max - min) + 1) + min;%0A                writer.write(randomNum + %22%5Cn%22);%0A            %7D%0A            writer.flush();%0A            writer.close();%0A        %7D catch (IOException e) %7B%0A            System.out.println(e);%0A        %7D%0A    %7D%0A%0A    private void readFromFile(String fileName) %7B%0A        try%7B%0A            BufferedReader file = new BufferedReader(new FileReader(fileName));%0A            ArrayList%3CInteger%3E arrayList = new ArrayList%3CInteger%3E();%0A            while (file.ready()) %7B%0A                String s = file.readLine();%0A                int number = Integer.parseInt(s);%0A                if(number %3E= 900) %7B%0A                    arrayList.add(number);%0A                %7D%0A%0A            %7D%0A            file.close();%0A            int sum = 0;%0A            System.out.println(%22Array is:%22);%0A            for (int i = 0; i %3C arrayList.size(); i++) %7B%0A                System.out.println(arrayList.get(i));%0A                sum += arrayList.get(i);%0A            %7D%0A            System.out.println(%22Size is %22 + arrayList.size());%0A            int avg = sum / arrayList.size();%0A            if(avg %3E 950) %7B%0A                System.out.println(%22Test failed%22);%0A            %7D else %7B%0A                System.out.println(%22Test passed%22);%0A            %7D%0A            System.out.println(%22Current average = %22 + avg);%0A%0A        %7D%0A        catch (FileNotFoundException e) %7B%0A            System.out.println(e);%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%7D%0A

Create WriteReadFile.java