Go to Post You can't derail a thread that had no "rails" to begin with. - bkahl [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #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
  #2   Spotlight this post!  
Unread 18-06-2007, 21:07
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: lowest to highest

http://www.developerfusion.co.uk/show/3653/9/

Check out that page it seems to be what your looking for
  #3   Spotlight this post!  
Unread 18-06-2007, 21:14
notaPINKtruck's Avatar
notaPINKtruck notaPINKtruck is offline
Registered User
AKA: Ryan Julian
FRC #0233 (The Pink Team)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Berkeley, CA
Posts: 73
notaPINKtruck is a splendid one to beholdnotaPINKtruck is a splendid one to beholdnotaPINKtruck is a splendid one to beholdnotaPINKtruck is a splendid one to beholdnotaPINKtruck is a splendid one to beholdnotaPINKtruck is a splendid one to beholdnotaPINKtruck is a splendid one to behold
Send a message via AIM to notaPINKtruck
Re: lowest to highest

Java libs do this for you.

Code:
import java.util.Arrays;
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();
  }
  
  Arrays.sort(numbers);
  
  //int median=median();
}
http://java.sun.com/j2se/1.4.2/docs/...il/Arrays.html
__________________

Rockledge HS/Cocoa Beach HS & NASA Kennedy Space Center
Team 233: "The PINK Team"



Last edited by notaPINKtruck : 18-06-2007 at 21:18.
  #4   Spotlight this post!  
Unread 18-06-2007, 21:36
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
Re: lowest to highest

i didnt know of that thanks alot. that just made life so easier.
__________________
, Sean

TEAM 867
-electrical
-pneumatics
-programming



2008 Autodesk Visualization Grand Prize Winner
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lowest Number Molten Chit-Chat 25 06-04-2007 15:34
Highest Score? EricH FIRST Lego League 17 12-12-2006 00:24
Lowest seed to win a regional Cody Carey General Forum 12 02-04-2006 22:34
Lowest Budget?? Moloch Regional Competitions 13 28-03-2005 00:21
HIGHEST SCORE archiver 2001 2 24-06-2002 02:17


All times are GMT -5. The time now is 19:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi