Question
**7.5 Use of a Unidirectional Array ( 10 points ): Write a Java program FilterDuplicates.java that reads in ten numbers. The numbers could be completely
**7.5 Use of a Unidirectional Array (10 points): Write a Java program FilterDuplicates.java that reads in ten numbers. The numbers could be completely distinct or there could be duplicates of some number or numbers. There should be no rule on how many duplicates - so, dont assume fixed number/s. The program should read these numbers and then display the number of distinct numbers discounting the duplicates. So, in case a number appears multiple times, your program should display that number only once. You can use an array to do this. While your program reads the numbers, it can keep storing them to an array if a number read in is new. If the number is already in the array, your program can ignore it. Finally, print the number of unique numbers and the array of numbers itself.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started