Computers and Technology

Write a program that takes its input from a text file of strings representing numbers of type double. This program should take input from the user specifying the name of a file containing decimal numbers, and should output the average and standard deviation of the numbers in the file. First, calculate the average (sum all the doubles, then divide the result by the number of doubles. Then, calculate the standard deviation as follows: Sum the squares of each number divided y the average of all numbers. (n1 / average)2 (n2 / average)2 (n3 / average)2 ... Divide the result by the number of doubles in the file Finally, take the square root of this number. This is the standard deviation. Your program's output should look as follows:. Count: [number of doubles in the file] Average: (average of the doubles in the file) Standard deviation: (standard deviation of the numbers in the file]

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 19:00, brittneyrenae7338
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words. size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words. size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
image
Computers and Technology, 24.06.2019 07:00, janeliles
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
image
Computers and Technology, 24.06.2019 08:30, 5theth
Intellectual property rights are exclusive rights that protect both the created and the creation. ipr offers exclusively what benefits to the person or people covered by it
Answers: 3
image
Computers and Technology, 24.06.2019 11:20, isabelperez063
Every telecommunication setup uses two devices: one device to transmit data and one device to receive data. which device transmits frequencies to mobile phones? towers transmit frequencies to mobile phones.
Answers: 1
Do you know the correct answer?
Write a program that takes its input from a text file of strings representing numbers of type double...

Questions in other subjects:

Konu
English, 18.09.2019 19:00