Answer:
The answer to this question can be given as:
Class definition:
public class Averager //define class Average.
{
private int sum = 0;
//define variable sum.
private int count = 0;
//define variable count.
public int getSum() //define function getSum().
{
return sum; //return value.
}
public void add(int x)
//define function add().
{
sum = sum + x; //calculate sum
count=count+1; //increase value of count.
}
public int add(int x)
//define function add().
{
return count; //return value.
}
public double getAverage() //define function getAverage().
{
return (double)sum/count; //return value
}
}
Explanation:
The above class definition can be described as:
- In the above class definition first we define a class that is " Averager". In this class we define two integer variable that is "sum and count" and assign a value that is 0. Then we define a functions :
- First we define getSum() function in this function we does not pass any value and the return type of this function is int that will return an integer value.
- Then we define add() function we use this function two times but both functions have different from each other.
- In first time implementation, we define this function and the return type of this function is void which means it does not return any value. In this function, we calculate the sum value and increase the value of the count variable by 1.
- In second time implementation, we define this function and the return type of this function is int which means it will return a value. In this function, we will return the count variable value.
- At the last, we define a getAverage() that calculates the average of the added values in the sum variable and returns its value.
Answer:
Following are the solution to this question:
Explanation:
This algorithm uses the divide and rule approach works, which splits the list into two sublists depending on if they are smaller or larger than the pivotal factor. It has O(n*log n) complexity.
It splits down the list in more than one version frequently till every sublist becomes based on a single element and fuses it to offer an ordered array. The merge type works according. It has O(n*log n) complexity.
Please find the attachment file of the sorting.
Answer:
Pre-processors look at organize traffic and screens parcel transmissions by examining andreassembling divided data.Frag2:preprocessor that battles against IP fracture attacks.Attackers sends a fragmentedTCP bundle with header data that gets entrance through a firewall.At the equivalent time,other parcels with vindictive information "slip" by the firewall undetected because of the fragmentationbeing so little by overwriting the header information.The frag2 pre-processor is specificallydesigned to break down bundle discontinuity to search out noxious information in the sections, which iswhy this pre-processor ought to never be turned off.Stream4:preprocessor Snort uses to coordinate assault marks over numerous packets.Anattacker endeavors to send different parcels into the system conveying parts of the attackpayload which are required to be reassembled by the host so as to start an attack.Stream4 stores the bits of the mark until all bundles are transmitted.Once they are alltransmitted, Stream4 finishes the signature and an alarm is created.
Explanation:
Hello <span>TheCelloAlex1645 </span>
Answer: <span>The BIOS is a small program run by a computer when first powered on. its primary function is to stabilize the machine and devices on the motherboard so that the operating system can be loaded and take control of the computer.
Hope this helps
-Chris</span>