Question: There is a virus file named Sunday.txt , when this file is downloaded to a folder, it begins to check other . txt files
There is a "virus" file named "Sunday.txt when this file is downloaded to a folder,
it begins to check other txt files and overwrite the files content. Following are the
code details for simulating this virus propagation.
Create Files with Initial Content:
Create new text files with the content "Monday".
Print Initial Content:
Print the content of each of the text files.
Create and Populate "Sunday.txt:
Create a new text file named "Sunday.txt with the content "Sunday".
Update Other Files with "Sunday.txt Content:
For each text file in the current directory:
If the file is not "Sunday.txt:
Overwrite the file's content with the content of
"Sunday.txt
Print Merged Content:
Print the content of all text files, including "Sunday.txt
Feel free to write it in Java, Python or any other programming language, turn in
your executable code and output to dl dropbox. Here is the sample output:
Content of filetxt: Monday
Content of filetxt: Monday
Content of filetxt: Monday
Content of filetxt: Monday
Content of filetxt: Monday
Content of all txt files after updating:
Content of filetxt: Sunday
Content of filetxt: Sunday
Content of filetxt: Sunday
Content of filetxt: Sunday
Content of filetxt: Sunday
Content of Sunday.txt: Sunday
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
