Answer:
The solution code is written in Python.
- fileName = input("Enter file name: ")
- target = input("Enter target character: ")
-
- with open(fileName, "r")as reader:
- content = reader.read()
- print(content.count(target))
Explanation:
Firstly, use <em>input() </em>function to prompt user for a file name. (Line 1)
Next, we use input() function again to prompt user input a target character (Line 2)
Create a reader object and user <em>read() </em>method to copy entire texts from to the variable<em> content </em>(Line 4 - 5).
At last we can get the number of times the specified character appears in the file using the Python string built-in method <em>count() </em>(Line 6)
Answer:
My answer could not be submitted because of some signs and symbols in my solution.
So, I've added the answer and a comprehensive explanation as an attachment.
Note that the question is answered using Python programming language.
Explanation:
Lines that start with # are used to explain the program
<em>See attachment</em>
The word DoS refers to the Disk Operating System. In the case given above, if it happens that there is a distributed DoS attack, the attacker then sends messages directly to the BOTS. Bots refer to internet or web robots. Hope this answer helps. The answer is the first option.