This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Future Value Calculator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Future Value Calculator" Watch "Future Value Calculator" New topic
Author

Future Value Calculator

Evan Cristofori
Greenhorn

Joined: Feb 02, 2007
Posts: 18
Hi All,

I was wondering if someone could show me an example of a future value calculator:

" F = P(1+rate)^t "

where
F = future value
P = initial deposit (principal)
rate = (annual) interest rate (expressed as a fraction, e.g. 0.06)
t = number of years invested

Also,

The user needs to be able too input each parameter:

"Please input the principal: ______"
"Please input the annual interest rate: ______"
"Please input the number of years invested: ______"

Then,

The program should run the calculator and output the information:

"The future value of your investment after ___ years is : ______"

Thanks,
Evan
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> I was wondering if someone could show me an example of a future value calculator:

if you are a beginner, have a crack at it yourself - you'll learn more that
way (the downside is you may end up with a few self-inflicted wounds!)

if you get stuck, post a specific question and include the code you've tried.
Evan Cristofori
Greenhorn

Joined: Feb 02, 2007
Posts: 18
Hey,

I was going to... I just wanted to compare my results to someone elses.

Here is my code I came up with:



How does it look?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

It looks good.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Future Value Calculator
 
Similar Threads
Use of Math.pow?
JSP
New to ArrayList
I can't see the error in this page
Did I do this right? (Interest calculator)