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
Which tab is used to configure editing restrictions in Word 2016? Review References Security Developer
Ipatiy [6.2K]

Answer:

Review Tab is the correct answer to the given question .

Explanation:

Giving the permission to file in word 2016

  • Click on the Review tab and select the restrict tab .
  • Chose the option allow this type of editing .
  • After that choose the option No changes .
  • Pick the section of the document they want to authorize the adjustments.
  • After that there are multiple option are seen select accordingly  as user need and press ok button .
  • Click on the start permission there is option is seen Start enforcement and press the button option start Enforcing Protection.
  • After that feeding the password if the user need the password is in encrypt form then press encrypt option and click ok .

If the user need to read the file

  • Click on the Review tab and select the restrict tab .
  • After that choose the option "Stop Protection" .
  • Giving the password you are feeding in the permission of file  .
  • Finally the user will edit the document

4 0
3 years ago
Read 2 more answers
Windows uses a memory-management technique known as ________ to monitor which applications you use most frequently and then prel
lukranit [14]

Answer:

SuperFetch

Explanation:

Superfetch is a memory management technique on windows service that enables or fetch frequently use applications on systems and launch them faster because the frequently use applications has been preload into the system memory for easy access when they want to be used.

SuperFetch always takes notice of all application running on your system in which when you exit a frequently used application SuperFetch will preload them immediately since it is saved on the system memory.

One of the most important part of Superfetch is that it saves alot of time because you don't have to search the applications before you get access to them in as far as the application was frequently used.

5 0
2 years ago
What is the main idea of this article? Please someone help me. I will give brainliest answer
mart [117]
The main idea of this article is that theme parks are conducting scientific research that is benefiting the community. Hope this helps!
8 0
3 years ago
How do you start using the Internet?
fgiga [73]

Answer:

it's

D. open web browser

3 0
2 years ago
Read 2 more answers
A _____ stores definitions, such as data types for fields, default values, and validation rules for data in each field.
PIT_PIT [208]
The answer to this question is the term Data Dictionary. A Data Dictionary or also known as metadata repository is a set of information that is stored which contains data, meanings, and values. The data dictionary can be used as a tool for communication between the stakeholders.
5 0
2 years ago
Other questions:
  • A set of communication rules for the computer to follow is called, what?
    10·2 answers
  • Software that gives network administrators the ability to provide computer assistance from a central location by allowing them t
    15·1 answer
  • my airpods just do not seem to connect if i try to pair them, reset them, they have this continuous green light, please help me
    12·1 answer
  • Processors for most mobile devices run at a slower speed than a processor in a desktop PC.
    9·2 answers
  • Do you agree that technology can be used to commit acts of violence ? Explain why or why not
    11·1 answer
  • Since the rules cannot address all circumstances, the Code includes a conceptual framework approach for members to use to evalua
    8·1 answer
  • Answer if you know Javascript, html, css, python, and Ruby.
    12·1 answer
  • which term describes the layer of software that resides between the virtual operating system and the physical hardware it runs o
    5·1 answer
  • Why is experience in their own factory setting
    13·1 answer
  • By definition, what is the process of reducing security exposure and tightening security controls?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!