id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

byngcompsci@gmail.com > investmentCalc
prev  |  next  |  chance

investmentCalc() -- The simple interest formula, compounded yearly, is given by the formula: 

      A = P(1 + r)





where A = The total amount of money you have after the investment
      P = Principle, the amount of money you invested
      r = rate, the interest rate of the investment
      n = number of years the investment grows.  

Write a method that returns A (the amount) to the nearest dollar, given P, r, and n as parameters. 

investmentCalc(1000, 0.15, 10) → 4045
investmentCalc(100, 0.07, 100) → 86771

...Save, Compile, Run (ctrl-enter)

public int investmentCalc(int P, double r, int n) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 15

Copyright Nick Parlante 2017 - privacy