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
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