Question: Folder System: You will implement a Folder class that represents a folder in a simplified file system. Each folder can contain files ( represented as

Folder System:
You will implement a Folder class that represents a folder in a simplified file system. Each folder can contain files (represented as strings) and other subfolders (aka Folder Class objects). You will implement recursive methods to calculate the total number of files, compare folder contents, and display the folder structure. This project should also include a flow chart in addition to the algorithm.
The Folder Class will have the following attributes. The folders name (as a string), it will also have a list that can hold "files" represented as strings, and lastly the folder class will have a list of "subfolders (Folder objects)
Your Folder class should contain the following methods which are accessible from a menu.
add_file: Which will take a file name and add it to the folder.
add_subfolder: Adds a subfolder (another Folder object) to the current folder. All folder names should be unique.
select_folder: Takes a folder name and makes that the current open folder from which methods will start from.
__count_files: Recursively counts the total number of files in the folder and all its subfolders. This method should also be private.
__eq__: Compares a folder and a string. They are equal if they have the same folder name.
__len__: Returns the total number of files in the folder and all its subfolders.
__str__: Returns a string representation of the folder, showing the folder name, its files, and its subfolders, using indentation for nested subfolders. There should be a menu item to print a folder.
Example Output:
```
===Menu===
==Current Folder: Start Folder==
1) add File
2) add Folder
3) select Folder
4) print Folder
=============
>>input: 2
>>input Folder
Name: hello Folder
.

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!