Created
February 27, 2014 09:59
-
-
Save bitwiser/9247324 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.lang.*; | |
| class test{ | |
| public static void main(String[] args){ | |
| Scanner s = new Scanner(System.in); | |
| int investment; | |
| double interest,fv5,fv10,fv15,fv20; | |
| System.out.print("Enter investment: "); | |
| investment = s.nextInt(); | |
| System.out.print("Enter interest: "); | |
| interest = s.nextDouble(); | |
| fv5 = investment*Math.pow((1+interest),5); | |
| fv10 = investment*Math.pow((1+interest),10); | |
| fv15 = investment*Math.pow((1+interest),15); | |
| fv20 = investment*Math.pow((1+interest),20); | |
| System.out.println("Future value for 5 yr: "+fv5); | |
| System.out.println("Future value for 10 yr: "+fv10); | |
| System.out.println("Future value for 15 yr: "+fv15); | |
| System.out.println("Future value for 20 yr: "+fv20); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment