In this exercise, you must compute the amount of occurrences of a given value in an array
(that is, the amount of time that this value appears in the array). For that, fill the
occurrences()
method, which returns the number of
occurrence of lookingFor
in tab
.
To compute this value, simply sweep over the array counting for the amount of cells containing the searched value. You thus need an extra variable for that.