Exercise 3: Removing duplicates

Go over Chapters 7-9, making sure you understand how to work with arrays in Java.

Write a program to do the following: The user types some integer n, followed by n numbers, each number being between 0 and 100, inclusive. The program should then display all the distinct numbers there are.

Here's a sample run. The computer reads in twelve numbers and prints out the number 4 in this case because the user just typed four different numbers (21, 42, 56, and 75).

How many numbers? 12
Number 1: 42
Number 2: 56
Number 3: 42
Number 4: 75
Number 5: 75
Number 6: 42
Number 7: 21
Number 8: 42
Number 9: 75
Number 10: 21
Number 11: 42
Number 12: 21
4

On to Exercise 4: Koch curve.