JAVA ON TOM (Thoroughly Obedient Moron)

Could any one help me to produce source codes of 5 questions, please ?

1. the maximum of the numbers,
2. the count of the numbers,
3. the sum of the numbers,
4. sum of squares of the numbers,
5. the variance of the numbers. variance = (sum of squares -sum*sum/count)/count

the standards data set should be 1, 2, 4, 6, 0

Comments

  • : Could any one help me to produce source codes of 5 questions, please
    : ?
    :
    : 1. the maximum of the numbers,
    : 2. the count of the numbers,
    : 3. the sum of the numbers,
    : 4. sum of squares of the numbers,
    : 5. the variance of the numbers. variance = (sum of squares
    : -sum*sum/count)/count
    :
    : the standards data set should be 1, 2, 4, 6, 0
    In a for-loop do the following:
    1: [code]
    if (number[i] > max) max = number[i];
    [/code]
    2: [code]
    count++;
    [/code]
    3: [code]
    sum = sum + number[i];
    [/code]
    4: [code]
    sumSqr = sumSqr + number[i]*number[i];
    [/code]
    After the loop calculate the variance using the results from the loop.
  • : : Could any one help me to produce source codes of 5 questions, please
    : : ?
    : :
    : : 1. the maximum of the numbers,
    : : 2. the count of the numbers,
    : : 3. the sum of the numbers,
    : : 4. sum of squares of the numbers,
    : : 5. the variance of the numbers. variance = (sum of squares
    : : -sum*sum/count)/count
    : :
    : : the standards data set should be 1, 2, 4, 6, 0
    : In a for-loop do the following:
    : 1: [code]:
    : if (number[i] > max) max = number[i];
    : [/code]:
    : 2: [code]:
    : count++;
    : [/code]:
    : 3: [code]:
    : sum = sum + number[i];
    : [/code]:
    : 4: [code]:
    : sumSqr = sumSqr + number[i]*number[i];
    : [/code]:
    : After the loop calculate the variance using the results from the
    : loop.

    thanks for sharing. But do I need to write extra some source codes for each
    question such as private Sum, private Count,... in public class ?
Sign In or Register to comment.

Howdy, Stranger!

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

Categories