Question: (15 points) Write a recursive function dirPrint0 that takes as parameters a pathname of a folder as a string and an integer indent and prints
(15 points) Write a recursive function dirPrint0 that takes as parameters a pathname of a folder as a string and an integer indent and prints to the screen the pathname of every subfolder contained in the folder, directly or indirectly. The subfolder path names should be output with an indentation that is proportional to their depth with respect to the topmost folder and should use the parameter indent to achieve this. The example below illustrates the execution of the function on several sample folders. Two sets of folders (can be found in the zip flle containing the template and posted to D2L: >>> dirPrint ('count', 5) 3. count count \A countlAIA countlAlAIA count\B count\B\A countlB\AIA count\p\p count\BIB\A countlBBNALA countle count\cIA >>> dirPrint ('Test',2) Test TestlTest Testitesti\Test1-A Test\TestlVTest1-ATestl-A-A TestlTest1\Test1-ATesti-A-AVA Test\Test1\Test1- TestiTestllTesti-B\Test1-B-A TestlTestllTest1-B\Testl-B-B TestiTestllTesti-c Test \ Test1\Test1-c\C2\C'31 Test TestilTestl-Cic21e31\A Test Testl\Testi-C1c21c311A\A rest \ Test 1 \ Testi-C102\C31 \ ALALALA TestItestiTesti-cicNa2 TestlrestiTestl-ciea TestiTest2 TestiTest21A TestiTest2A\B-1 TestiTest2NAVB-2 Test\Test2\B TestiTest2 BB1-1 TestiTest2 BN81-182-2 TestiTest2181B1-1182-21B Testirest21c Tostirest3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
