Decidedly average homework problem

This is a discussion on Decidedly average homework problem within the C++ Programming forums, part of the General Programming Boards category; Hey guyz this is gonna be my last question (THANKS IN ADVANCE):
4. Display Data
Write a function to read ...

Decidedly average homework problem

Hey guyz this is gonna be my last question (THANKS IN ADVANCE):

4. Display Data
Write a function to read and display the contents of names and marks. You then ask the user for a name and using the linear search return the index to the user. If -1 is returned then the name is not in the file. Otherwise write out the name and mark for that student.
Next, sort the arrays, write them out and then ask the user for a name to search for. This time use the binarySearch to return -1 or an index. Display the studentís name and mark if found.

kk i will write it again (and by the question i mean intructions that r given to write this program):

4. Display Data
Write a function to read and display the contents of names and marks. You then ask the user for a name and using the linear search return the index to the user. If -1 is returned then the name is not in the file. Otherwise write out the name and mark for that student.
Next, sort the arrays, write them out and then ask the user for a name to search for. This time use the binarySearch to return -1 or an index. Display the studentís name and mark if found.

Oh, by question you meant to follow the instructions. No.
Do you have any questions that pertain to your attempts at writing the software?

Is it just me or is this like the fourth time in the last couple days someone has tried to trick people here in to doing their work for them? It's insulting that beginning students think people are so stupid that they'll be tricked by 'I DARE YOU!'.

i totaly get ur point....i do understand this language....i just need help with recrusion...plz help me and stop giving me stupid advices...if u dont wanna help then plz let others help me(with all due respect)...ty

Wow look, tons of source code, look how bad I am, I'm so bad I'm going to give you the answer so you don't learn anything. What's ironic is you'll interpret that as a joke.

You're just saying you can't do it, I'm willing to bet you haven't actually begun writing a program to even try putting the pieces together. If you're being given tests and assignments on algorithms you must have learning material given to you by a teacher, unless the assignment is to learn how to use Google. Honestly, I know I sound like an ass but are you understanding what I'm saying? People don't want to do others work for them. I know how mean and evil that seems, but few things are ever as they seem to be.

the end

u little (cin << insert insulting word here)............ all i wanted was some help from YOU. if i wanted help from the internet, i would have gone there first. Now, you've proved that these forums are useless and all of u guys are pansies looking from some attention. Good luck in life, loser.

Recursion is just a function designed to call itself. For example, the trick to a working binary search is that you have to make the search space smaller with every call, and to do that appropriately, you exclude half of it every time.

So the algorithm is something like this:
1. Find the midpoint
2. Check if the midpoint is the item
2a. If it is, you're done.
2b. If it isn't and there's more than two items, split the list by the midpoint On the other hand, if you've reduced the list and haven't found the item, the search failed.
3. Search the new list from step 1.

The search space needs to be sorted (ascending or descending) for the binary search to work, because again the point is to ignore half the search space every pass. Anyway, for a recursive function to be considered working, it has to know when to stop, and that is step 2 of my explanation.