Help -- New to Java



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

.



Relevant Pages

  • Re: Convert String to Object - Newbie Question
    ... Roedy Green Canadian Mind Products ... The Java Glossaryhttp://mindprod.com ... They should have a newbie Javadoc format. ... (Btw, your name scared me the first time I saw it, it's ...
    (comp.lang.java.help)
  • Re: Microsoft: The New Commodore
    ... was completely surprised when I ran it for the first time as I also ... all for C/assembly and native compiled code but I don't hate Java ... it because learning to use the IDE is more complex that learning the ... simple graphics like plotting a single pixel on the screen. ...
    (comp.sys.cbm)
  • Re: C# vs. C++ Calling the overridden base class members from derived classes.
    ... This is the first time you have ever suggested anything of this ... > about second-guessing the standard. ... It is often possible to accomplish through design approach in one language ... If not, the intent is not to replace Java, it is to defend against Java by ...
    (comp.lang.cpp)
  • Re: Microsoft: The New Commodore
    ... except for about a minute or maybe less, it's all database activity. ... was completely surprised when I ran it for the first time as I also ... all for C/assembly and native compiled code but I don't hate Java ... Mono is the open source open source version ...
    (comp.sys.cbm)
  • Re: I got blasted by my boss and java guru for suggesting lisp
    ... your boss into letting you do your next project in Lisp if you only ... you to demo Scheme for them). ... Kawa for the first time, and found it really easy to get moving with [ ... create more elegant code that what I'm used to seeing in Java, ...
    (comp.lang.scheme)