How do I make a historgram, find the mean & SD using an array??? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How do I make a historgram, find the mean & SD using an array???

Deuce613Deuce613 Posts: 1Member
Hi,
If someone can help me, Id really appreciate it. The task is to input numbers (seperated by commas) into a textarea and then when the user clicks "plot" the mean and standard deviation appear in the appropriate textareas. In addition, a histogram is constructed from the numbers in the array. I have some code but it does not seem to work.

Can someone give me some tips. I am new at all this stuff.




David's Computer Program






var A = new Array();
var freq = new Array();

var A = s.split(",");

var mean;
var sum=0;


A = document.davidForm.main1.value.split(",");


function clearMainScreen() {
window.document.david.main1.value = "";
}

fucntion displayAvg() {
var mean = document.davidForm.main1.value;
for (var i = 0; i = A.length-1; i++) {
A[i] = parseInt(A[i]);
sum = sum + A[i];
}
mean = (sum / A.length);
window.alert("mean");
}


function standardDeviation (){
var smsq = sum+sum
var stdr = Math.sqrt((smsq-smsq/A.length)/A.length-1))

for (var i=0; i=0 && A{i} <=9{
freq[0]=freq[0]+1
}
}

var bin = Math.floor(A[i]/10);

freq[bin] = freq[bin]+1


Math.random

for (var i=0; i<A.length; i++){
A[i]=Math.round(Math.round( )*100)
}


</script>







Welcome to David's Amazing Webpage














image
image
image
image
image
image
image
image
image
image




Mean

Standard Deviation







Comments

Sign In or Register to comment.