I'm not sure where you are on your
Java Journey, so excuse me if I start with some basics. Try moving your calculation & display into a method that takes an argument. If your main looked like this:
could you imagine what the compute method might look like?
Ryan's Integer hint (posted while I was typing, you rascal!

) is a good next step, figuring out how to use a command line parameter that the user passed to main.
[ April 18, 2005: Message edited by: Stan James ]