fork download
  1. import java.lang.Math;
  2.  
  3. class Ideone {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. // bankACalc;
  8. int bankAyears = 3;
  9. double bankADeposit = 5000;
  10. double bankARate = 0.04;
  11.  
  12. double bankAFinalValue =bankADeposit *(1 + bankARate)*Math.pow(0.04,5);
  13.  
  14.  
  15. System.out.printf("BankA %s CD of %.2f at 4.00%% rate is worth $%.6f ", bankAyears, bankADeposit, bankAFinalValue);
  16.  
  17.  
  18.  
  19. }
  20.  
  21. }
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
BankA 3 CD of 5000.00 at 4.00% rate is worth $0.000532