View Single Post
  #1   Spotlight this post!  
Unread 18-06-2007, 20:04
seanl's Avatar
seanl seanl is offline
"The Everything person"
FRC #0867 (Absolute Value)
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Arcadia, CA
Posts: 267
seanl will become famous soon enoughseanl will become famous soon enough
lowest to highest

how would i go about arranging mixed up numbers in an array from lowest to highest. the length is set to x. so you dont know what the numbers are because the user is going to be entering the numbers
heres what i got so far its in java but the part i need should be the same as C++.
public static void main(String[]args)
{
EasyReader IO=new EasyReader();
System.out.println("How many numbers do you want to enter?");
int length=IO.readInt();
int numbers[]=new int [length];
for(int x=0;x<length;x++)
{
System.out.println("please enter your "+(x+1)+"st number");
numbers[x]=IO.readInt();
}
int highLow[]=highLow(numbers,length)
//int median=median();


}
public static int[] highlow(int[]numbers,int length)
{
int[]highLow=new int[length];

for(int x=0; x<length;x++)
{
for(int(y=0; y<length;y++)
{

}
}
}
__________________
, Sean

TEAM 867
-electrical
-pneumatics
-programming



2008 Autodesk Visualization Grand Prize Winner