File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes problems with math methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problems with math methods" Watch "problems with math methods" New topic

problems with math methods

Roxanne Billings

Joined: Apr 01, 2011
Posts: 8
Just when I think I am starting to get this stuff . . . I get stuck again. (please help)

I am writing a program that has a user enter their first name, last name, year of birth. Then I am trying to output their age, create a random amount of years in the future, and calculate their future age.

I have most of the beginning working so far. . . but now I am stuck between creating the random array of int years (future years) and calculating that result with a primitive type int.

Here is the code I have so far . . .

Thank you in advance for any assistance you can provide me!

Greg Brannon

Joined: Oct 24, 2010
Posts: 563
Check for an answer on DIC.

Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

What do you mean by "create a random amount of years in the future"? this could mean you're trying to find one date some random amount of time in the future, or you could be trying to find a random number of years, all of which are in the future.

Being a good programmer means knowing, understanding, and being able to explain the problem clearly to everyone else. So, let's focus on one small part...what EXACTLY are you trying to create?

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: problems with math methods
It's not a secret anymore!