Question: Write a java program that prompts the user to enter an integer and then displays the digits whose frequencies is equal to the one of

Write a java program that prompts the user to enter an integer and then displays the digits whose frequencies is equal to the one of its digits. If none of the digits has a frequency equal to the one of its digits the program should display your Student ID number.
Example1:
Input : 21676
Output: 2167
Because 6 appeared twice which is equal to the leftmost digit.(21676)
And 217 appeared once which is equal to the one (21676)
Example2:
Input: 345644
Output: 4 because 4 appeared three times which is equal to the leftmost digit(345644).
Example2:
Input: 8924937
Output:9 because 9 appeared twice times which is equal to the two digit(8924937).
 Write a java program that prompts the user to enter an

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!