Link to home
Start Free TrialLog in
Avatar of Member_2_4942450
Member_2_4942450

asked on

The median of a list is its middle value when the values are placed in order. What I want to to is write an application that allows you to enter nine double values and display them and their median.

The median of a list is its middle value when the values are placed in order. What I want to to is write an application that allows you to enter nine double values and display them and their median.

Wouldn't it be like this. Allowing me to enter 9 number and then display there median.
public class Median
{
   public static void main(String[] args)
   {
     // final int NUM_ELEMENTS = 4;
      int[] someNums = {5, 10, 15, 20, 25};
      int x;
      System.out.print("At start of array: ");
      for(x = 0; x < someNums.length; ++x)
         System.out.print(" " + someNums[x] );
      System.out.println();
     // methodGetsArray(someNums);
       someNums = reverseArray(someNums);

      System.out.print("Array in reverse order: ");
      for(x = 0; x < someNums.length; ++x)
         System.out.print(" " + someNums[x]);
      System.out.println();
   }
  
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_4942450
Member_2_4942450

ASKER

When I compiled I got this

 ----jGRASP exec: javac -g MedianOfAList.java
Note: MedianOfAList.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details

What does this mean?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Unchecked operations is a warning - it still compiled and it still should work
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial