Question: CHALLENGE ACTIVITY 2 . 5 . 1 : Creating a recursive method. 5 2 2 5 6 2 . 3 5 7 8 1 9

CHALLENGE
ACTIVITY
2.5.1: Creating a recursive method.
522562.3578194. qx 3z qy 7
Jump to level 1
Complete increaseAmount 0's recursive case:
If amount 400, call increaseAmount(0 to compute the next week's amount as the current week's amount plus 15.
Otherwise, call increaseAmount(0 to compute the next week's amount as the current week's amount plus 50.
Ex: If the input is 420, then the output is:
week: 1, amount: 420
week: 2, amount: 435
week: 3, amount: 450
week: 4, amount: 465
week: 5, amount: 480
Study completed
import java.util.Scanner;
public class FundDetails {
public static void increaseAmount (int week, int amount){
System.out.println("week: "+ week +", amount: "+ amount);
if (week ==5){
System.out.println("Study completed");
}
else {
I* Your code goes here */
}
 CHALLENGE ACTIVITY 2.5.1: Creating a recursive method. 522562.3578194. qx 3z qy

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!