Question: Write a recursive method called that takes an integer and a string parameter. The integer parameter represents the depth of a folder inside a file

 Write a recursive method called that takes an integer and a

Write a recursive method called that takes an integer and a string parameter. The integer parameter represents the depth of a folder inside a file structure and the string parameter represents the name of a file. The method should return a String constructed to represent the number of folders it takes to reach the specified file. If the integer parameter is 0 , the file exists at the current level and thus no folder structure is needed. For example: You are not allowed to construct any structured objects other than Strings (no array, ArrayList, StringBuilder, Scanner, etc) and you may not use a while loop, for loop or do/while loop to solve this problem; you must use recursion

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!