Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I know the picture is blurred and missed some work on few lines, but can anyone

ID: 3816660 • Letter: I

Question

I know the picture is blurred and missed some work on few lines, but can anyone give me the idea of this code by reading the pseudo code?

I do rate the answer, so please answer as accurate as possible, Thanks!

Declare a vari of type Fitesystemintry named kid set kid equal to ent get child If kid is not equal to null If remainName s length is o OR NOT kid, isD Raise a File AL Recurse using kid as the FilesystemEntry, nName as the name ar End If Else LE remaintamo s tength is Declare a variable of type FilesystemEntry named newfile Set newFule equal to Use addChild() to add new File (curName, fitesizel as ent s child Else Declare a variable of type Filesystemen try named newoir Set nevoir equal to File createDirectorytcurNamel Use addChild() to add nehoir as ent child Recurse using newDir as the FilesysterEntry, remainName as the name, End If

Explanation / Answer

A filesystem is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk. The word is also used to refer to a partition or disk that is used to store the files or the type of the filesystem.
for example: A folder consists of many sub folder and file.
An exception is a problem that arises during the execution of a program. When an Exception occurs the normal flow of the program is disrupted and the program terminates abnormally, which is not recommended, therefore, these exceptions are to be handled.
Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function.

There is no definition of remainName mentione anywhere in code, hence i am assuming it's initial value as a directory type.

Coming to the pseudo code now,
"Declare a variable of type FileSystemEntry named kid"
"Set kid is equal to ent.getChid(curName);"

In the first and second statement a variable of name "kid" of type "FileSystemEntry" is being declared and initialized.

"If kid is not equal to null
   If remainName's length is 0 OR NOT kid.IsDiretory()
       Raise a FileAlreadyExistsException
   Else
       Recurse using kid as the FileSystemEntry, remainName as the name....
   End If"

Here, nested if-else conditions are used to check if the initial value of object kid is file or a directory, if it is not a directory means it is a file and hence an exception is raised.
If initial value of kid is not a file then a recursive function will enter into the directory.

"Else If remainName's length is 0
   Declare a variable of type FileSystemEntry named newFile
   Set newFile equal to FileSystemEntry.createFile(curName, fileSize)
   Use addChild() to add newFile as ent's child"

Here they are checking if there are any files present into the directory or not, if NOT, a file is being created by name of "newFile" and the size of the file is set to a define value(depending on fileSize). Newly created file is then set to its corresponding parent.

   "Else
       Declare a variable of type FileSystemEntry named newDir
       Set newDir equal to FileSystemEntry.createDirectory(curName)
       Use addChild() to add newDir as ent's child
       Recurse using newDir as the FileSystemEntry, remainName as the name,...
End If"

Above pseudo code it the sum of both the above mentioned detail.
First, it is creating a new directory with name "newDir" and setting its value as Directory with the help of function.Once directory it is mapped to its parent/root directory.In the last line, a recursive function is used to get into the tail of the root firectory.

I have tried to justify the answer as correct as i can based on the information provided. Thanks.