def introduction (): print """ Simple interest calculator ------------------------------- With given values for the principle, rate and time period this program will calculate the interest accrued as well as the new amount (principle plus interest). """ def getInputs (): principle = input("Enter the original principle: ") rate = input("Enter the yearly interest rate %") rate = rate / 100.0 time = input("Enter the number of years that money will be invested: ") return principle, rate, time def calculate (principle, rate, time): interest = principle * rate * time amount = principle + interest return interest, amount def display (principle, rate, time, interest, amount): temp = rate * 100 print "" print "With an investment of $", principle, " at a rate of", temp, "%", print " over", time, " years..." print "Interest accrued $", interest print "Amount in your account $", amount # Main function def main (): principle = 0 rate = 0 time = 0 interest = 0 amount = 0 introduction () principle, rate, time = getInputs () interest, amount = calculate (principle, rate, time) display (principle, rate, time, interest, amount) main ()