Question: Write multiplySequence ( ) ' s base case to output = and result if inVal is less than or equal to 3 .

Write multiplySequence()'s base case to output "=" and result if inVal is less than or equal to 3. End with a newline.
Ex: If the input is 9, then the output is:
9*6*3=162
import java.util.Scanner;
public class DetermineProduct {
public static void multiplySequence(int inVal, int result){
System.out.print(inVal);
result = result * inVal;
/* Your code goes here */
else {
System.out.print("*");
multiplySequence(inVal -3, result);
}
}
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
int inVal;
inVal = scnr.nextInt();
multiplySequence(inVal,1);
}
}

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 Programming Questions!