Re: Problems with calling from another class.
- From: "HalcyonWild" <Halcyon.Wild@xxxxxxxxx>
- Date: 17 Nov 2005 10:50:20 -0800
JohnL86 wrote:
> In my java class we have to take a number from one class that is found
> when the user inputs the range of numbers (i.e. 1-10000) and then how
> many random numbers to be chosen to find the average. The second class
> program is supposed to take these numbers and then average them. My
> problem is that I don't know how to write this second class. Any help
> you guys can give will be appreciated.
make the second class , name it AvgCalculator or something.
write a method in this second class, calcAverage().
Now you know how to pass many numbers to a method, and how a method
returns and how to calculate average. You also should know how to
instantiate a class and call its methods. If you know about static
methods, then think how it can be fit in this scenario. Also if you
have any specific questions, like why you are getting wrong results or
your code doesnt compile, this is the place to ask.
Not doing your homework for you, but trying to give you a general
direction.
.
- References:
- Problems with calling from another class.
- From: JohnL86
- Problems with calling from another class.
- Prev by Date: Restoring redirected System.out
- Next by Date: Re: Where is libjavaplugin_oji.so in JRE 1.5.0_05?
- Previous by thread: Re: Problems with calling from another class.
- Next by thread: Re: Problems with calling from another class.
- Index(es):
Relevant Pages
|