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: 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: 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)
  • Re: Trouble with Java concepts
    ... If someone were devising a control system for an automobile today from ... use it for the first time would search for the clutch, ... someone coming to Java from C++ tends to look around ... Coaching, problem solving, economical contract programming. ...
    (comp.lang.java.programmer)
  • Re: Some dude had a total meltdown in my java class today
    ... end by taking a lime green crayon and scribbling in ... >> Java is....Java. ... overloaded when I tried to take it the first time. ...
    (alt.2600)