Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

image text in transcribed
(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions