Find numbers that has been in the row more than 3 times and print it. Numbers ar
ID: 3533314 • Letter: F
Question
Find numbers that has been in the row more than 3 times and print it. Numbers are as follows:
1. 12 13 2 6 4 10
2. 5 7 3 12 10 6
3. 6 2 1 5 3 8
4. 8 10 2 6 12 9
5. 6 23 2 3 8 10
6. 4 8 3 10 6 1
7. 5 8 6 3 2 12
Note: I am not hard coading these numbers. All these numbers are in a text file, so I have to read from the file and print out on the screen.
Answer: Print out which numbers are more than 3 times.
For example output should be like this : Here are the numbers appeared more than 3 times: 12 appeared 4 times. 2 apeared 5 times. 6 appeared 7 times. 3 appeared 5 times. 8 appeared 5 times. 10 appeared 5 times.
Thanks in advance...
Explanation / Answer
import java.util.*;class CountNumberOccurrence {public static void main(String[] args) throws Exception{int array[]={2,4,2,5,2,4,3,4,5,2};for(int counter =0;counterRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.