Re: Is there a better way to do this?
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Mon, 30 Jul 2007 13:48:29 -0400
"John" <jtlinux1@xxxxxxxx> wrote in message
news:46aa95be$0$4052$9a566e8b@xxxxxxxxxxxxxxxxxx
I gave it a shot, to answer the question that that person posted[...]
here a couple of days ago
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)
So I wrote my program, tested it with some small numbers.[...]
But is it wel written? And I don't mean comments. I mean does
it follow the OO rules?
For some problems, OO is the best tool for the job. For this problem,
I don't think OO is the best tool for the job. The problem specification
reads like a recipe, listing each step to be performed, and the order in
which to perform those steps. It is extremely natural to translate the
problem description almost directly into a procedural (i.e. non-OO)
program.
- Oliver
.
- Follow-Ups:
- References:
- Is there a better way to do this?
- From: John
- Is there a better way to do this?
- Prev by Date: Re: @override?
- Next by Date: Re: Is there a better way to do this?
- Previous by thread: Re: Is there a better way to do this?
- Next by thread: Re: Is there a better way to do this?
- Index(es):