Functions
func outputText (text string) {
fmt.Println(text)
}futureValue := calculateFutureValue(investmentAmount, expectedReturnRate, years)
func calculateFutureValue(investmentAmount, expectedReturnRate, years float64) float64 {
return investmentAmount * math.Pow(1+expectedReturnRate/100, years)
}func calculateFutureValues(investmentAmount, expectedReturnRate, years float64) (fv float64, rfv float64) {
fv = investmentAmount * math.Pow(1+expectedReturnRate/100, years)
rfv = fv / math.Pow(1+inflationRate/100, years)
return
}Last updated