Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 05-04-2007, 03:52 PM buble sort C++ array
Junior Talker

Posts: 2
Name: death
Trades: 0
hey i need a program for this problem
Create a program that has a searchable array of 100 distinct positive integers between 0 and 1000. Your program should first create the 100 element array and fill it with random numbers. Once the array is filled, you need to sort it using either a bubble or selection sort. Finally, you will ask the user to enter a number and the program will search the array to find whether it is contained in the array's random numbers. The user will be rewarded with a message saying at which element the number was found, or else that the number was not found. The user will be prompted to search for additional numbers if they wish and when the user finishes, the program will output the array in rows of ten numbers each.

Last edited by quest23; 05-04-2007 at 03:55 PM.. Reason: formating
quest23 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-05-2007, 05:18 AM Re: buble sort C++ array
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
school project obviously


http://www.webmaster-talk.com/coding...bble-sort.html
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-07-2007, 04:00 AM Re: buble sort C++ array
jo_cstd's Avatar
Skilled Talker

Posts: 56
Trades: 0
Create a function that'll fill the array with random numbers. (use rand() and a for loop)
Create a sort function.
Create a search function. (Since your array is sorted, use binary search)
Create main().
- initialize your array of integers.
- call random number function
- call sort function
- prompt user for a number
- call search function for the user's number
- display result then prompt again
- display arrays content

*just search the net for codes (search, sort)

Can we see what you've done so far?
jo_cstd is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 10:43 AM Re: buble sort C++ array
Super Talker

Posts: 146
Trades: 0
Do you want us to do your homework?
krish is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 01:55 PM Re: buble sort C++ array
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
If this is in fact your homework I really hope you don't intend to do anything in computer science. I've had to implement this sort on more than one occasion in a few different languages, and trust me it is no where near the hardest algorithm you'll have to implement in college. Posting online for someone to do your homework will get you kicked out by the way, I've seen it.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to buble sort C++ array
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.40149 seconds with 12 queries