[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
Solved

# Finding the Mean and SD of values to xN

Posted on 2004-12-01
Medium Priority
234 Views
Suppose we have a set of values x1, x2, . . . , xN.
Write an application that calculates the mean and standard deviation of its command line arguments.
For example,
java MyApp 1 9 3 7
should produce output similar to:
For data: 1.0,9.0,3.0,7.0,
mean=5.0
standard deviation=3.1622776601683795
0
Question by:MAragorn
• 3
• 2

LVL 37

Expert Comment

ID: 12715147
We're not here/allowed to make your assignements.
0

LVL 13

Expert Comment

ID: 12715148
homework is prevented here, we can only provide tips and solve existing code problems
0

Author Comment

ID: 12715160
sorrry... i'll put in what i've worked out as soon as i write it up
0

LVL 37

Accepted Solution

zzynx earned 375 total points
ID: 12715176
To make you familiar with command line arguments:
- Start making a program that accepts some arguments
- Let it print out those parameters.

- Then parse those arguments as doubles
- increment the sum (initially 0) with that double
- divide the sum by the number of arguments to become the mean
0

Author Comment

ID: 12729343
thanks for your help... i managed to solve the mean but the SD was well hard
0

LVL 37

Expert Comment

ID: 12729417
>> i managed to solve the mean but the SD was well hard
Good to hear.
Thanks for accepting
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
###### Suggested Courses
Course of the Month19 days, 9 hours left to enroll