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

 

mortgage


Suppose we get a loan for "base" dollars, which increases by "interest" percent at the beginning of each month. We pay "payment" dollars at each month's end. How much do we still owe after "months" months have passed?


mortgage(40, 10, 10, 1) → 34.0
mortgage(100, 5, 10, 1) → 95.0
mortgage(100, 5, 10, 2) → 89.75

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

public double mortgage(double base, double interest, double payment, int months) { }

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: 210

Copyright Nick Parlante 2017 - privacy