Question: Need help for the following hw problem. It just needs problem solving process done for this code. *Attached is an overview of problem solving process

Need help for the following hw problem. It just needs problem solving process done for this code. *Attached is an overview of problem solving process and problem explanation** Has to be in that format!! Please due tonight!!
code:
import java.util.Scanner;
public class RecFunctions {
public static double fn1(int n){
if(n == 1){
return 1;
}
else{
return (1.0 / n) + fn1(n - 1);
}
}
public static void fn2(int n, int c){
if(n == 0){
return;
}
else{
for(int i = n - 1; i
System.out.print("*");
}
System.out.println();
fn2(n - 1, c);
for(int i = n - 1; i
System.out.print("*");
}
System.out.println();
}
}
public static void fn2(int n){
fn2(n, n);
}
public static void main(String args[]){
Scanner in = new Scanner(System.in);
System.out.print("Enter value of n for function One: ");
int n = in.nextInt();
System.out.printf("Result of function 1 is %.3f ", fn1(n));
System.out.print("Enter value of n for function Two: ");
n = in.nextInt();
System.out.println("Executing Function Two ");
fn2(n);
}
}
 Need help for the following hw problem. It just needs problem
solving process done for this code. *Attached is an overview of problem
solving process and problem explanation** Has to be in that format!! Please
Problem1. (20 points) Recursive Coding Problem. Using the Problem Solving Process. Write a Java application that implements these two functions using recursive methods a. First Recursive Function. When one passes an integer as input (n for example), the return should return (output) the sum as follows: Example If the function's argument is 4, the function should return the value of 2.083 which is the sum of: 1 1/2 1/3 1/4. am This application will calculate the solution for the following function: Please enter an integer: 4 x= 1 + 1/2 + 1/3-1/4-2.083. Constraint: Must implement recursively. b. Second Recursive Function. The second function when you pass it an integer (n for example) is supposed to print lines of asterisks in the following format: 8 8 *N 9N

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!