Advertisement
Fakhru

Untitled

Nov 13th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class FixedInvestment {
  6. public static void main(String[] args){
  7.  
  8. getTotalReturn();
  9. //System.out.println(getTotalReturn());
  10.  
  11. }
  12.  
  13. public static double getTotalReturn(){
  14. double investmentAmount = 200;
  15. double annualInterestRate = 0.05;
  16. int numberOfYears = 1;
  17. double totalReturn;
  18.  
  19. totalReturn = investmentAmount * annualInterestRate * numberOfYears;
  20. System.out.println( "Deposit Amount : RM" + investmentAmount + " \n Annual Interest Rate :" + annualInterestRate + "%\n Number Of Years :" + numberOfYears + " YEARS" + "\n Total Return on the Investment After years above: " + totalReturn);
  21.  
  22. return totalReturn;
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement