Class: CompoundInterestCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/compound_interest_calculator.rb

Instance Method Summary collapse

Instance Method Details

#amount_earned(principle, interest, compound, time) ⇒ Object



3
4
5
# File 'lib/compound_interest_calculator.rb', line 3

def amount_earned(principle, interest, compound, time)
	@result = (principle*(1 + (interest/100)/compound)**(compound*time)).round(2)
end