6 Replies - 675 Views - Last Post: 13 June 2013 - 03:47 PMRate Topic:

Help please. Creating a list of sellers and using bubble sort.

Hi there! This forum will surely come in handy in for my future career as a programmer, which i just recently noticed that I love. Thanks for being here!

I have been working on this code for about a week and been stuck with the same part last three days.
I can't get the bubble-sort to work!

The task is to write a code that asks for information from 6 sellers, where there are different levels of sallary depending on how many items are sold.. (name, number, district and amount sold).
This information should then be sorted, showing the seller with most sold first, and then writing this information to a file. I have done it all except the actual sorting.

I understand that I should use a bubble array, but I can not seem to get it to work. Not even sure if I have written it correctly. I get no error message or anything, but when I try it out the array is not sorted, showing the one with most sold first. Having an overall hard time understanding functions as well, so that might be a problem.

Re: Help please. Creating a list of sellers and using bubble sort.

I have a feeling that the bubble-sort code should have my array-name säljarinfo instead of vektor. (Got vektor from a book). Tried calling the method with Bubblesort(säljarinfo); but that did not work either. Just says " the name does not exist in its current context".