import java.io.*; class Average1 { // A program that calculates the average of a series of integers. // It asks how many integers there are in total, then prompts for each one. public static void main(String[] args) throws IOException { BufferedReader in = Text.open(System.in); int sum=0,count=1,number; System.out.print("Type the number of integers that will be entered: "); number=Text.readInt(in); while(count<=number) { System.out.print("Enter number "+count+": "); sum+=Text.readInt(in); count++; } System.out.println("Average is: "+Text.writeDouble((double)sum/number,5,3)); } }