Results 1 to 1 of 1
Thread: Using separate methods
- 10-31-2010, 05:31 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 56
- Rep Power
- 0
Using separate methods
Hi guys. I'm trying to create a program using a separate private method.
It is a program that prints the future of 4 peoples work, when given 5 command line arguments by user. The first is the present year, the other 4 are random birth dates of people.
I dont understand what this piece of code does. Can anyone care to explain?
printFuture(presentYear, yearsLeftWorking)
printFuture(presentYear, yearsLeftWorking)
printFuture(presentYear, yearsLeftWorking)
printFuture(presentYear, yearsLeftWorking)
I want the prgram to print out their future using a seprate method instead of just one main method. It should output something liek the following:
$ java Future 2009 1991 1989 1959 2008
Person 1 has "amount of years" years left to work.
In 2010, person 1 will have "amount of years - 1 " years left to work
In 2011 .... ..
In 2011...
...
Person 1 will retire in "year"
Person 2 has "amount of years" left to work.
In 2010, person 2 will have "amount of years - 1" years left to work.
In 2011....
....
Person 2 will retire in "year"
etc
etc upto person 4.
Kind Regards
Shyam
Thanks
Similar Threads
-
How to use functions in separate files
By theodorekon in forum New To JavaReplies: 2Last Post: 04-20-2010, 01:50 PM -
How to separate return value ??
By doha786 in forum New To JavaReplies: 1Last Post: 03-10-2010, 03:43 PM -
How can my applet read from a separate .jar?
By DenniGa in forum Java AppletsReplies: 2Last Post: 03-27-2009, 03:34 PM -
Should I separate my code into separate files?
By Inks in forum New To JavaReplies: 0Last Post: 03-26-2009, 12:12 AM -
combining two separate codes into one
By jaiminparikh in forum Advanced JavaReplies: 22Last Post: 02-18-2009, 05:35 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks