Thanks for all of the help and suggestions! Based on some research, reviewing loop basics, and working with the code, I came up with the following function to calculate the mode. It's still rough - I need to format the output, hide some of the info I've been displaying for debugging purposes...
Salem,
Thanks! Both of your suggestions helped:
1) Initializing the array took care of the primary garbage output issue, so that the numbers are now making more sense
2) Moving that cout statement has the frequency printing at exactly the right point.
I've got two issues left to work out:
1)...
PS -
Since I'm having so many problems with the code I posted above, if it's easier for me to scrap that and start over, no problem. I just want something that works!
Also, if it's REALLY necesary for me to post all of the code for the app I can, but the rest of it is working fine - I just...
I'm working on a call monitoring app at the office and along with the other data that is to be processed, my manager wants the app to calculate and print onscreen the statistical mode for the number of phone calls made by each department. The mode is the most common number, so if a dept. has 5...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.