Question

Computer Network Let the RRT’s be 40, 45, 56, 131, 87 and 68 for 6 ping...

Computer Network

Let the RRT’s be 40, 45, 56, 131, 87 and 68 for 6 ping requests to the same host. Write a program(Java) to calculate the minimum, maximum, mean, standard deviation of the given RRT which helps in finding the ping stats. Provide output as screenshot and include the program source code as well.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE:

public class RRT {

public static void main(String[] args) {

// TODO Auto-generated method stub

int a[]= {40, 45, 56, 131, 87, 68 };

int min=a[0],max=a[0],mean=0;

double standardDeviation=0.0;

for(int i=0;i<a.length;i++)

{

if(min>a[i])

min=a[i];

}

for(int i=0;i<a.length;i++)

{

if(max<a[i])

max=a[i];

}

for(int i=0;i<a.length;i++)

{

mean=mean+a[i];

}

mean=mean/6;

for(int i=0;i<a.length;i++) {

standardDeviation += Math.pow(a[i] - mean, 2);

}

standardDeviation= Math.sqrt(standardDeviation/a.length);

  

System.out.println("Minimum of RRT is "+min);

System.out.println("Maximum of RRT is "+max);

System.out.println("Mean of RRT is "+mean);

System.out.println("Standard deviation of RRT is "+standardDeviation);

}

}

Output:

Minimum of RRT is 40 Maximum of RRT is 131 Mean of RRT is 71 Standard deviation of RRT is 30.894983411550815

Add a comment
Know the answer?
Add Answer to:
Computer Network Let the RRT’s be 40, 45, 56, 131, 87 and 68 for 6 ping...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program that instantiates an array of integers named scores. Let the size of the...

    Write a program that instantiates an array of integers named scores. Let the size of the array be 10. The program then first invokes randomFill to fill the scores array with random numbers in the range of 0 -100. Once the array is filled with data, methods below are called such that the output resembles the expected output given. The program keeps prompting the user to see if they want to evaluate a new set of random data. Find below...

  • Question 8 A = 23n + 36n2        B = 6 + nlog2(n) + n      C =...

    Question 8 A = 23n + 36n2        B = 6 + nlog2(n) + n      C = log2n + 36n2 Which one of the following is correct? A. TA = O(n2)    TB = O(n)   TC = O(log2n) B. TA = O(n2)      TB = O(nlog2(n))  TC = O(n2) C. TA = O(n2)      TB = O(+ nlog2(n))       TC = O(log2n) D. TA = O(n2)      TB = O(n)      TC = O(n2) 0.5 points Question 9 Three criteria are used to determine whether a data structure is...

  • Copy the following java codes and compile //// HighArray.java //// HighArrayApp.java Study carefully the design and...

    Copy the following java codes and compile //// HighArray.java //// HighArrayApp.java Study carefully the design and implementation HighArray class and note the attributes and its methods.    Create findAll method which uses linear search algorithm to return all number of occurrences of specified element. /** * find an element from array and returns all number of occurrences of the specified element, returns 0 if the element does not exit. * * @param foundElement   Element to be found */ int findAll(int...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT