import
javax.swing.JOptionPane;
public class lab15 {
public
static void main(String[] args) {
// get in the number of integers to read in
int input =
Integer.parseInt(JOptionPane.showInputDialog("How many numbers?"));
// declare the array
int[] arr = new int[input];
// set the running total to 0
int total = 0;
double ave = 0;
// now read in those numbers
for (int a = 0; a < input; a++) {
arr[a] =
Integer.parseInt(JOptionPane.showInputDialog("Enter a number"));
// once each is read in add it to the
running total
total += arr[a];
}
// calculate the average
ave = total / input;
for (int b = 0; b < input; b++) {
// if the number in question is greater
than the average, print it
if (arr[b] > ave)
JOptionPane.showMessageDialog(null, ""+arr[b]+" is over average");
}
}
}