<em>How does multithreading affect the throughput of a GetFile Server hosting many very large files?</em>
Answer:
It create multiple threads of large file which eventually causes in slowing down the speed of server which results in slower response time.
<em>How does multithreading affect the average response time for a GetFile server hosting a few small files?</em>
Answer:
Multiple threads in smaller files result in rapid response time and enormous process speed in small files.
Answer:
The code above tries to read a file using the scanner class in java programming language.
But it was done properly.
First, the scanner class library is not imported to the program.
Second,the syntax used in this program is an invalid way of reading a file in java programming language using the scanner class.
Lastly, "String s = file.nextLine();" is not a proper way of reading each line
To correct this problem; use the following code;
import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;
public class ReadFileWithScanner {
try
{
public static void main(String args[]) throws FileNotFoundException {
File text = new File("data.txt");
Scanner file = new Scanner(text);
int lines = 1;
while(file.hasNextLine()){
String line = filw.nextLine();
System.out.println("line " + lines + " :" + line);
lines++;
}
catch (ArithmeticException ae)
{
System.out.println(ae.getMessage());
}
}
}
Answer:
A computer virus
Explanation:
A computer virus is categorized as malicious software that is built just like any other program out there to cause damage, steal, or disrupt a victim’s computer system. They infect systems and networks in various ways. Most are designed to move in stealth and attach themselves to other programs. Others, however, exploit an unpatched vulnerability and propagate themselves into harmful programs. Depending on how they are designed, most viruses insert a copy of themselves, spread rapidly from within files of a computer, and even extend to other computers in a network.