Question: Given the following code, mark the lines you would change / update for this method can correctly calculate the exponential / power For example, do

Given the following code, mark the lines you would change/update for this method can correctly calculate the exponential/power
For example,
do_something2(12,2); //should return 144
do_something2(5,5); // should return 3125
public static int do_something (int val1, int val2){
if valz {
}
return ;
}
return val1+ do_something vall, val2-1);
change do_something2(val1-1, val2-1)
change + to %
No changes, it is correct as it is.
change return 0 to return 1
change do_something2(val1, val2-2)
cast val1 to a double
change + to *
change do_something2(val1-1, val2)
 Given the following code, mark the lines you would change/update for

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!