Question: 3 . 2 8 LAB: Count the digits Write a recursive method called digitCount ( ) that takes a positive integer as a parameter and
LAB: Count the digits
Write a recursive method called digitCount that takes a positive integer as a parameter and returns the number of digits in the integer Hint: The digit count increases by whenever the input number is divided by
Ex: If the input is:
the method digitCount returns and the program outputs:
q
LAB ACTIVITY
: LAB: Count the digits
LabProgram.java
Load default template...
import java.util.Scanner;
public class LabProgram
TODO: Write recursive digitCount method here.
public static void mainString args
Scanner scnr new Scanner
System.in;
int num, digits;
num nextInt ;
digits num
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
