Write a program that reads any numbers from 1to 10 and counts the occurrences of each numbers excluding 0 entered. If the user enters a number outside of range, the user is to be notified and asked for another number.
By using arrays and methods
i am having trouble with counting the number of occurrence of the integers.
can anyone help me in this
My experience in various languages is limited, however the logic is relatively straight forward so I am certain I can help you figure this out. Can you offer any other specifics like what you have done or how you are attempting to solve this?
You're not actually counting the number of occurances, it just happens. The comments for getIntegersWithCount() basically call for the integer that the user enters to be used as counts[ index ].
Join our real-time social learning platform and learn together with your friends!