You may use your books and notes in solving these problems. You may not use the Internet, you may not use Eclipse, and you may not talk to anyone. For questions, please use the discussion forum for clarifications/issues.
You must turn in your work on paper in class. Indicate how many hours you worked on the problem and what resources (book, notes) you consulted in doing the problems. Your submission of the work with your signature indicates your adherence to the Duke Community Standard.
You may also turn in hard-copy rather than submitting your work. No submissions, hard-copy or electronic, will be counted if received after 2:20pm on Friday, October 14.
For example, if the following call is made:
numDistinct(18, 3, 4)
the method should return 3 because the parameters represent 3 different
numbers (the values 18, 3 and 4).
By contrast, the following call:
numDistinct(6, 6, 6)
would return 1 because there is only 1 distinct number among the three
parameters (the value 6). The values passed to your method might appear
in
any order whatsoever, so you cannot assume that duplicate values would
appear together.
For example, if the following call is made:
numDistinct(7, 31, 7)
the method should return 2 because there are 2 distinct numbers among the
parameters (the values 7 and 31).
Write your solution to numDistinct below. (5 points)