Question: Problem 3 : [ 2 Marks ] Trace the following question The main method code ( assume this works ) char [ ] str =

Problem 3: [2 Marks]
Trace the following question
The main method code (assume this works)
char[] str =('C','R','I','M','E');
tryIt (str,'N',3);
for (int ind =0; ind < str. length; ind++)
System. out.print (str [ind]) ;
System.out.printin(;
//The tryIt method logic with char [], char and int as input variables
str [number]= letter;
if (number ==2)
str [number]='A';
else {
number -=1;
tryIt (str, str [number -2], number); }

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!