Did you say beer ? ... actually a good ol' glass of iced tea would probably do much better.
To get rid of the duplicate display. At the end of LoadArray(), you have a call to DisplayArray():
length = counter-1;
sorted = false;
DisplayArray(list,length); //delete this line
>I could probably do a lot of those couts through the switch statements, is there any preference on how that is done?
I agree with you, for example the Smallest(), Largest(), and Average() functions. Since you are returning the value anyway, why not print it in ProcessChoice? Of course with the Sort() function, the way you have done it is best.
Ice tea it is, sweet tea of course.
I am about to try the file input after having cleared up the small details on the other.
Keep your fingers crossed.
I took out the DisplayArray after the first LoadArray call, and left the DisplayArray at the end of the LoadArray function. Seems to work ok.
>Ice tea it is, sweet tea of course.
Sweet tea is the best.
Have fun cleaning up the details ... and ... yes a little sleep will be nice about now.
when I sort, it misses one of the numbers
see number 12? why is that near the bottom?
2, 1, and 3, and it exhibits the same problem ... will not sort. Looks like a bug in the sort function.
Thanks for all your help. I will work more on it tomorrow before class and after the kids are off to school.
Get some sleep!
I don't know what kind of sort you are using. The only one I know is the bubble sort. If you can use the bubble sort, I think this will work:
Also, there is a built in quicksort in c++. You may not be allowed to use this. It's callled qsort.
void Sort(float list,
for(passCount = 0; passCount<length-1; passCount++)
if(list[searchIndex] < list[passCount])
temp = list[passCount];
list[passCount] = list[searchIndex];
list[searchIndex] = temp;
sorted = true;
Signing off til tomorrow afternoon.
That sort worked perfectly! I am having a little difficulty with the file input but should be able to work that out.
thanks again for all your help!