Suppose you want to create a Go program that performs simple interest calculations. Since you've learned about functional decomposition, you want to apply it to this program and divide it into three simple functions:
getData()— Should ask the user to input theamountof money, theinterestRateand thenumberOfYears, and then return those three variables.calculateSimpleInterest()— Should perform interest calculation and return the final interest amount and the total sum.printResult()— Should print out the calculatedsimpleInterestfirst and thetotalAmountafterward in two separate lines in the following format, with two decimal places:
The interest is 400.00
The total amount is 1400.00Here is the formula for calculating the interest:
In the Sample Input below, the first number is the starting amount of money, followed by the interestRate in %, and last is the numberOfYears.
To make this coding challenge simpler and avoid type casting, every variable must be of the float64 type.