Help -- New to Java
- From: Al <doubletrouble_s@xxxxxxxxx>
- Date: Wed, 25 Jul 2007 17:53:12 -0700
Hello,
I am taking a java class for the first time. The first HW was easy. I
am stuck on the 2nd. I know the logic, I can write it in C, but with
Java I am having problems and it is due tomorrow. Is there any site
where I can find small sample programs. Appreciate any help. This is
my HW prob.
Create a java program that generates 10000 random integer numbers
between 1 and 500. Then use the generated numbers to calculate:
- the mean (average) of all numbers
- the standard deviation
- the largest and smallest number
- the median number (50% is above it, 50% is below it)
- the mode (the number(s) that occurs most frequently)
Hints:
- Use the java.lang.Math class
- Write a static method to generate the numbers.
- For each type of calculation, use a separate static method
(function) returning an integer or double value.
- Use an array defined in the main() function to store the numbers.
Pass the array as a parameter to the other functions.
- Use java.util.JOptionPane to display all the results in one single
dialog.
- The class name should be StatFunctionsXXX where XXX is your name.
Thank you,
Al
.
- Follow-Ups:
- Re: Help -- New to Java
- From: Roedy Green
- Re: Help -- New to Java
- From: markacy
- Re: Help -- New to Java
- From: Bjorn Abelli
- Re: Help -- New to Java
- From: Jeff
- Re: Help -- New to Java
- Prev by Date: moving more than one image using a mouse
- Next by Date: Re: Help -- New to Java
- Previous by thread: moving more than one image using a mouse
- Next by thread: Re: Help -- New to Java
- Index(es):
Relevant Pages
|
|