1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
il63 [147K]
3 years ago
9

Create an array of numbers filled by the random number generator. (value = (int)(Math.random() * 100 + 1);) Print the array and

determine the smallest, largest, average, and calculate the standard deviation. Allow the client to pick the size of the array to be used and allow the client to repeat the process with a new array. Use a method to calculate the standard deviation. In statistics and probability theory, the standard deviation shows how much variation or dispersion from the average exists in a group of numbers. A low standard deviation indicates that the data points tend to be very close to the mean (also called expected value); a high standard deviation indicates that the data points are spread out over a large range of values. For a finite set of numbers, the standard deviation is found by taking the square root of the average of the squared differences of the values from their average value. For example, consider a population consisting of the following eight values: 2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0. These 8 data points have the mean (average) of 5.0. (2.0 + 4.0 + 4.0 + 4.0 + 5.0 + 5.0 + 7.0 + 9.0)/8.0 = 5.0.
Calculate the difference of each data point from the mean (average) and square this value.
Computers and Technology
1 answer:
Y_Kistochka [10]3 years ago
4 0

Answer:

Explanation:

the following is the code to run this (JAVA)

MeanStandardDev.java

import java.util.Random;

import java.util.Scanner;

public class MeanStandardDev {

public static void main(String[] args) {

// Declaring variables

int N;

double lower, upper, min, max, mean, stdDev;

/*

* Creating an Scanner class object which is used to get the inputs

* entered by the user

*/

Scanner sc = new Scanner(System.in);

// Getting the input entered by the user

System.out.print(" How many Random Numbers you want to generate :");

N = sc.nextInt();

System.out.print("Enter the Lower Limit in the Range :");

lower = sc.nextDouble();

System.out.print("Enter the Upper Limit in the Range :");

upper = sc.nextDouble();

// Creating Random class object

Random rand = new Random();

double nos[] = new double[N];

// this loop generates and populates 10 random numbers into an array

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

nos[i] = lower + (upper - lower) * rand.nextDouble();

}

//calling the methods

min = findMinimum(nos);

max = findMaximum(nos);

mean = calMean(nos);

stdDev = calStandardDev(nos, mean);

//Displaying the output

System.out.printf("The Minimum Number is :%.1f\n",min);

System.out.printf("The Maximum Number is :%.1f\n",max);

System.out.printf("The Mean is :%.2f\n",mean);

System.out.printf("The Standard Deviation is :%.2f\n",stdDev);

}

//This method will calculate the standard deviation

private static double calStandardDev(double[] nos, double mean) {

//Declaring local variables

double standard_deviation=0.0,variance=0.0,sum_of_squares=0.0;

/* This loop Calculating the sum of

* square of eeach element in the array

*/

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

{

/* Calculating the sum of square of

* each element in the array    

*/

sum_of_squares+=Math.pow((nos[i]-mean),2);

}

//calculating the variance of an array

variance=((double)sum_of_squares/(nos.length-1));

//calculating the standard deviation of an array

standard_deviation=Math.sqrt(variance);

return standard_deviation;

}

//This method will calculate the mean

private static double calMean(double[] nos) {

double mean = 0.0, tot = 0.0;

// This for loop will find the minimum and maximum of an array

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

// Calculating the sum of all the elements in the array

tot += nos[i];

}

mean = tot / nos.length;

return mean;

}

//This method will find the Minimum element in the array

private static double findMinimum(double[] nos) {

double min = nos[0];

// This for loop will find the minimum and maximum of an array

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

// Finding minimum element

if (nos[i] < min)

min = nos[i];

}

return min;

}

//This method will find the Maximum element in the array

private static double findMaximum(double[] nos) {

double max = nos[0];

// This for loop will find the minimum and maximum of an array

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

// Finding minimum element

if (nos[i] > max)

max = nos[i];

}

return max;

}

}

the OUTPUT should give;

How many Random Numbers you want to generate :10

Enter the Lower Limit in the Range :1.0

Enter the Upper Limit in the Range :10.0

The Minimum Number is :1.1

The Maximum Number is :9.9

The Mean is :6.30

The Standard Deviation is :2.98

cheers i hope this helps!!!

You might be interested in
Choose the correct term to complete the sentence.
Andre45 [30]

Answer:

Technology

Explanation:

Edge 2021

8 0
2 years ago
Each time an end user clicks a hyperlink, the browser generates a(n) _____ page request that is sent to the designated web serve
irina1246 [14]

Answer:

HTTP GET

Explanation:

The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers and it uses the GET method to request data from the specified resource using the TCP/IP Internet protocol.

4 0
2 years ago
Good information is characterized by certain properties. Explain how you understand these characteristtics of good information.
Sedbober [7]

Answer:

here is your ans

Explanation:

Characteristics of good quality information can be defined as an acronym ACCURATE. These characteristics are interrelated; focus on one automatically leads to focus on other.

Accurate

Information should be fair and free from bias. It should not have any arithmetical and grammatical errors. Information comes directly or in written form likely to be more reliable than it comes from indirectly (from hands to hands) or verbally which can be later retracted.

Complete

Accuracy of information is just not enough. It should also be complete which means facts and figures should not be missing or concealed. Telling the truth but not wholly is of no use.

Cost-beneficial

Information should be analysed for its benefits against the cost of obtaining it. It business context, it is not worthwhile to spend money on information that even cannot recover its costs leading to loss each time that information is obtained. In other contexts, such as hospitals it would be useful to get information even it has no financial benefits due to the nature of the business and expectations of society from it.

User-targeted

Information should be communicated in the style, format, detail and complexity which address the needs of users of the information. Example senior managers need brief reports which enable them to understand the position and performance of the business at a glance, while operational managers need detailed information which enable them to make day to day decisions.

Relevant

Information should be communicated to the right person. It means person which has some control over decisions expected to come out from obtaining the information.

Authoritative

Information should come from reliable source. It depends on qualifications and experience and past performance of the person communicating the information.

Timely

Information should be communicated in time so that receiver of the information has enough time to decide appropriate actions based on the information received. Information which communicates details of the past events earlier in time is of less importance than recently issued information like newspapers. What is timely information depends on situation to situation. Selection of appropriate channel of communication is key skill to achieve.

Easy to Use

Information should be understandable to the users. Style, sentence structure and jargons should be used keeping the receiver in mind. If report is targeted to new-comer in the field, then it should explain technical jargons used in the report.

4 0
2 years ago
What parts of the computer does it not need to function?​
Thepotemich [5.8K]
Fancy lights, mouse, keyboard, you can do fan but the computer will eventually overheat, it need coolant for it to run for a long while
6 0
2 years ago
Which is an example of an active visual interface? a display indicating the amount of ammunition for the currently equipped weap
AnnyKZ [126]

Hello.

The answer is : weapon a display indicating an object that can be explored by clicking on it a display indicating the types of weapons available a display indicating keys collected

An active visual interface is one in which a player can click to interact with the game mechanics.

have  a nice day

7 0
3 years ago
Read 2 more answers
Other questions:
  • The ____ contains the computer's "brain," the central processing unit (CPU).
    5·2 answers
  • Can someone help me with...A table can help? PLEASE
    8·1 answer
  • When preparing a document flowchart, the names of organizational departments or job functions should appear in theA) column head
    6·1 answer
  • What is the decimal value of 00001111
    14·1 answer
  • horseback riders, bicyclists, and skateboarders ____ the rules of right-of-way when they use the road ?
    7·2 answers
  • Mary can view the thumbnails of her presentation slides when she’s creating the slides which element of the programs interface i
    8·1 answer
  • Charlie makes pizza at a restaurant. The customers always compliment how great the pizza tastes. But Charlie takes a long time t
    7·2 answers
  • Given that n refers to a positive int use a while loop to compute the sum of the cubes of the first n counting numbers, and asso
    12·1 answer
  • Submit your business presentation that clearly compares and contrasts three different cell phone service plans. I have TO HAVE I
    14·1 answer
  • quizlet ann is a security professional for a midsize business and typically handles log analysis and security monitoring tasks f
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!