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

 

lenpelletier@gmail.com math > interest
prev  |  next  |  chance

interest(principle, rate, years) -- calculates the amount of interest (compounded yearly) an account makes for the given principle, rate, and years. Return your answer as an integer (truncate decimals).


interest(1000, 0.07, 10) → 967
interest(1000, 0.1, 20) → 5727
interest(1000, 0.15, 25) → 31918

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

public int interest(int principle, double rate, int years) { }

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: 10 Post-solution available

Copyright Nick Parlante 2017 - privacy