So I'm making a program for a Java class, and need to find the mean, mode, max, min, and median of a set of temperatures that I enter. Here's what I have so far:
import javax.swing.*;
public class Temps {
private int temp[] = new int[5];
String inputStr;
int inputInt = 0;
public void startApp()
{
for (int i = 0; i < temp.length; i++)
{
inputStr = JOptionPane.showInputDialog("Enter new temp.");
inputInt = Integer.parseInt(inputStr);
temp[i] = inputInt;
}
}
public static void main(String[] args)
{
Temps obj = new Temps();
obj.startApp();
}
}
Where and how do I start manipulating the values in the array? I have no idea where to start, and any help would be awesome.