I think I have done it right (It compiles) but I just blanked out and I am having trouble with the output.
Now I was told to place a loop in the actionperformed in order to call the random method and others, but I blanked out. I have tried findminimum + lowVal. But I gotten errors. advise please.import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Random; public class RandomNumbers4 extends JApplet implements ActionListener { FlowLayout flow = new FlowLayout(); Container con = getContentPane(); JButton cButton = new JButton ("Compute"); Font font = new Font("Times Roman",Font.BOLD, 12); JLabel ranVal = new JLabel("Random Values: "); JLabel lowVal = new JLabel ("Low Value: "); JLabel hiVal = new JLabel ("High Value: "); JLabel avVal = new JLabel ("Average Value: "); int Random[] = new int [5]; int value = 0; int max =0, min = 0; int sum = 0; public void init() { con.setLayout (flow); con.add(cButton); con.add(ranVal); con.add(lowVal); con.add(hiVal); con.add(avVal); ranVal.setFont(font); lowVal.setFont(font); hiVal.setFont(font); avVal.setFont(font); cButton.addActionListener(this); } public static int randomNumber (int value) { int choose=0; choose = 60 + (int)(Math.random()*40); return choose; } //maximum number generator public static int findMaximum(int maximum) { int max = 0; if (maximum > max) max = maximum; return max; } //average generator public static int findAverage (int sum) { int avg = 0; avg = sum/5; return avg; } public static int findMinimum(int minimum) { int min = 0; if (minimum < min) min = minimum; return min; } public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if (source == cButton) Random = new int[5]; int count = 0; double average = 0; int Max = 0; int Min = 100; int sum = 0; int number = 0; for (count = 0; count < 5; count++) number = 60 + (int)(Math.random() * 40); Random [count] = number; sum = sum + number; average = sum/5; } }