employer cover photo
employer logo
employer logo

Tin Roof Software

Is this your company?

Tin Roof Software Interview Question

Write a function to calculate compounding interest with the APR as a parameter

Interview Answers

Anonymous

Jan 3, 2017

Not sure what "years = years + 1" is for in the answer above. It may even cause an infinite loop.

2

Anonymous

Feb 29, 2020

using System; class Program { static void Main() { Console.WriteLine(CompoundInterest(1500, 0.043, 4, 6)); } /// /// CompoundInterest. /// static double CompoundInterest(double principal, double interestRate, int timesPerYear, double years) { // (1 + r/n) double body = 1 + (interestRate / timesPerYear); // nt double exponent = timesPerYear * years; // P(1 + r/n)^nt return principal * Math.Pow(body, exponent); } }

Anonymous

Jun 22, 2016

def interest(principle, val, years): for x in range(0,years): principle = principle * (1+val) years = years + 1 return principle