• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris
Bartenders:

problems with math methods

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!

RB
 
Bartender
Posts: 563
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check for an answer on DIC.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Look! It's Leonardo da Vinci! And he brought a tiny ad!
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic