Question: Java Write a static recursive method named frequencyCount(n,d) that returns the frequency of occurrence of a particular digit d in an integer n. For example,

Java

Write a static recursive method named frequencyCount(n,d) that returns the frequency of occurrence of a particular digit d in an integer n. For example, frequencyCount(1342457,4) returns 2,

but frequencyCount(1342457,6) returns 0.

The method frequencyCount(n,d) may not use local variables or static variables.

Create a project named Project7 containing a class named Program7 which contains the main method for this application as well as the method frequencyCount. The main method for this application reads in an integer n as well as a digit d and then calls the method frequencyCount to output the result on the screen.

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!