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
In what medium do web applications operate?
ki77a [65]

Answer

web browser

Explanation:

5 0
1 year ago
1. What does MS-DOS use for input?
Ket [755]

1. The answer is Command-line base

MS-DOS is a single user, single tasking OS that use a command line interface. MS –DOS is the perfect example of a command line interface. CLI is a text based interface used by operating systems and software and performs particular tasks by entering commands. Unlike the GUI (Graphical User Interface), the CLI uses a very easy mechanism which is not user friendly.  

2. The answer is carry electrical current

Transistors are semiconductor devices used to control the flow of electricity in circuits. They contain three layers of silicon that are used to amplify or switch electric currents. They are very fundamental in modern electronic devices and are considered one of the greatest inventions in modern history. In small quantities, transistors are used to make simple switches and digital logic. In huge quantities, transistors are interconnected and combined into small chips that create complex ICs, computer memories, and processors.

3. The answer is True

A peripheral device such as a keyboard, a mouse, or a printer is a hardware input or output device that gives the computer additional functionalities and serve as an auxiliary computer device. They are commonly known as I/O devices because they provide input and output information for the computer.

4. The answer is A: Interacts with or sends data to the computer

A peripheral device as mentioned above is used to input information into and get it out of the computer. In addition, an input device sends data, information, or instructions to the computer. Examples of input devices include, keyboard, mouse, graphics tablet, game controller, read only memory, and many more.

5. The answer is doc .

Doc file extension is the general default binary and XML-based format for Word 97 all the way to Word 2019. This file extension can contain formatted texts, tables, images, page formatting, and graphs. Depending on the versions of the Microsoft Word, the standards for the DOC extension change slightly from .doc to .docx


5 0
3 years ago
Try writing pseudo code that describes how your device uses input data to perform the action that you want.
Zielflug [23.3K]
// Input example:
var userInput = input("Action: ");
if(userInput == "run") {
// Run code
} else if(userInput == "stop") {
// Run code
} else {
// Run error code
}

// More-like-what-you-want example:
if(user.clickApp("Brainly")) {
// Open Brainly
} else if (user.clickApp("App")) {
// Open App
} else {
// Other if, else if, else statements
}
4 0
3 years ago
Certain files, such as the ____ and Security log in Windows, might lose essential network activity records if power is terminate
Hoochie [10]

Answer:

The answer to this question is a. Event log

Explanation:

Event log in Windows is a comprehensive record of security,system and application notifications stored by the Windows and it is used by administrators to determine problems in the system and foretell issues that going to happen in future.

Operating system and the Apps use event logs to keep account of important software and hardware activity that administrator can use to correct issues with the operating system.

7 0
3 years ago
EIPP:________.
nikdorinn [45]

Answer:

D. All of these choices are correct

Explanation:

Electronic invoice presentment and payment, otherwise known as EIPP are business-to-business systems that combine e-invoicing and e-payment processes for the purpose of sending invoices to customers via Web portal or via a secure network by the use of a third party service provider. They are also used for receiving payer-initiated, third-party-processed, and ACH-network-settled wire transfers.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog?
    13·2 answers
  • Assume you have a byte-addressable machine that uses 32-bit word (integers are 32-bit) and you are storing the following informa
    5·1 answer
  • Which of these browsers was the first widely adopted?
    12·1 answer
  • Which one is not the future of wireless technology?
    8·1 answer
  • python (Business: check ISBN-10) An ISBN-10 (International Standard Book Number) consists of 10 digits: d1d2d3d4d5d6d7d8d9d10. T
    12·1 answer
  • Which command can be used to find errors on a hard drive​
    6·1 answer
  • Which of the following best describes
    13·1 answer
  • Which job role requires you to create user guides for computer products and services?
    11·1 answer
  • Using an outline, how do you maintain your computer or cellphone​
    8·1 answer
  • Hazel has taught herself a variety of computer languages. She enjoys using her knowledge to write the programs for applications
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!