Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Standard deviation. Write a Java program that reads a set of floating-point data

ID: 3641855 • Letter: S

Question

Standard deviation. Write a Java program that reads a set of floating-point data values from the input. Where the first item will be an integer representing the number of (Floating point) values to follow. The first integer in the file is not to be included as one of the floating point values. The program should read each of the floating point values in, storing them into an (appropriately sized) array. The program should then calculate and print out (to the screen) the standard deviation of the floating values found in the file with two digits after the decimal point.

Explanation / Answer

import java.io.*; import java.util.*; public class StandardDev { public static void main(String args[])throws IOException { RandomAccessFile raf=new RandomAccessFile("d:/numfile.txt","r"); String st=raf.readLine(); int n=Integer.parseInt(st); double f[]=new double[n]; double sum=0; int i=0; while(i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote