How do I go about defining the average and total variables in the following script? Assistance is appreciated... Ben
import javax.swing.JOptionPane;
class minmax {
/** Main Method */
public static void main(String[] args)
{
final double TOTAL_NUMBERS = 5;
//Convert string to double
double Average = Double.parseDouble(averageString);
//Convert string to double
double total = Double.parseDouble(totalString);
// Prompt the user to enter a double value
for (int i =0; i < numbers.length;i++) {
String doubleString = JOptionPane.showInputDialog(null,
"Enter a double value","Input (double)",
JOptionPane.QUESTION_MESSAGE);
}
// Find the largest
int doubles = numbers[0];
for (int i = 1; i < doublenumbers.length; i++) {
if (doubles < numbers)
doubles = doublenumbers;
}
// Find the smallest
int doubles = numbers[0];
for (int i = 1; i < numbers.length; i++) {
if (doubles < numbers)
doubles = numbers;
}
// Prepare the results
String output = "The values are ";
for (int i = 0; i < numbers. length; i++) {
output += numbers + " ";
}
output += "\nThe largest number is " + doubles;
output += "\nThe smallest number is " + doubles;
output += "\nThe average number is " + average;
output += "\nThe total number is " + total;
// Display results
JOptionPane.showMessageDialog(null,doublevalue +
"Output", JOptionPane.INFORMATION_MESSAGE);
}
}