Hey all, we are supposed to do an assigment for class and no one has figured it out yet. I was hoping you could give a little guidence (NOT JUST GIVE THE CODE ANSWER) 
Assigment
My code thus far...
Now, first off, it doesnt work anyways.... but even if it did, I could only use numbers from -9999 to 9999...
Can someone point me in the right direction?
Thanks
Anthony
p.s. pardon the formatting... i couldnt get it all lined up
Assigment
Write a program application called Midpoint that prompts the user for a
series of numeric inputs until the user inputs either "m" OR "midpoint", at
which point the program reports the "midpoint" of all the numbers
entered, where midpoint is defined to be the middle real (i.e.,
decimal precision) number on a real number line between the lowest and
highest numbers.
E.g., if I input the following:
1, 4, -21, 5, 70, 12, 9, 0, 44, 2, "m"
Midpoint will respond:
"The midpoint is: 24.5" (Correction!!!!!)
Notice how the program looped indefinitely waiting for me to enter
either "m" or "midpoint". The program should use JOptionPane utilities
to accomplish its input/output operations
Notice also that the midpoint (as I've defined it) is not necessarily a
number you have input and that the midpoint can have a fractional (i.e.,
decimal expansion) part. You will need to treat the inputs as
floating-point (i.e., decimal precision) numbers, so you will need to use
either doubles or floats (I recommend using doubles)
My code thus far...
Code:
import javax.swing.JOptionPane;
public class Midpoint {
public static void main(String args[]) {
String userInput;
double doubleInput;
double large = -9999;
double small = 9999;
double midpoint = 0;
userInput = JOptionPane.showInputDialog("Enter a number (type 'Midpoint' or 'm'"+"\nfor the midpoint of entered numbers).");
while (!(userInput.equalsIgnoreCase("Midpoint") || userInput.equalsIgnoreCase("m")) ) {
doubleInput = Double.parseDouble(userInput);
if (doubleInput > large)
large = doubleInput;
else if (doubleInput < small)
small = doubleInput;
else;
userInput = JOptionPane.showInputDialog( "Enter a number (type 'Midpoint' or 'm'"+
"\nfor the midpoint of entered numbers).");
midpoint = (large + small) / 2;
}
JOptionPane.showMessageDialog(null, "The Midpoint is: "+midpoint);
System.exit(0);
}
}
Now, first off, it doesnt work anyways.... but even if it did, I could only use numbers from -9999 to 9999...
Can someone point me in the right direction?
Thanks
Anthony
p.s. pardon the formatting... i couldnt get it all lined up