Question: Your task in this assignment is to write a program that calculates annual compound interest. In terms of output, this programming assignment is very
Your task in this assignment is to write a program that calculates annual compound interest. In terms of output, this programming assignment is very similar to the last assignment i.e. prompt the user for their name and some numerical values and carry out a calculation. However, this assignment requires the use of multiple custom functions that must be designed using the constraints described later in this document. Below is a sample run with the user input in red: Please enter your name: Joe King Please enter the principal: 10000 Please enter the annual percentage rate: 5 Please enter the number of years: 20 Hello Joe King, the final amount after 20 years at 5.0% is $26532.97705144422 Here's output of another sample run (again, user input is shown in bold red): Please enter your name: Amanda Please enter the principal: 100 Please enter the annual percentage rate: 5.5 Please enter the number of years: 20 Hello Amanda, the final amount after 20 years at 5.5% is $291.77574906040877 To help clarify, here are some specifics and/or constraints: (1) Your program will require at least three user-defined functions. Feel free to add any extra functions you think are necessary. A function that prompts the user for their name and returns it to the calling statement. This function should not take any arguments. O O O A function that receives a single argument (a string that describes a piece of data), uses that argument when prompting the user for some data, returns the data to the calling statement. A function that receives three arguments that represent the principal amount, the annual compound interest rate, and the number of years. This function uses those three piece of data to calculate the total amount and returns that amount to the calling statement. (2) The main part of your program should make use of the functions (outlined above) in such a way as to satisfy the problem statement i.e. get the user's name and information, and print the total amount after compound interest is applied. (3) Your output should be exactly like the sample runs shown above (of course, actual input values and calculations will vary depending on the provided inputs); (4) You must include a meaningful header, use good coding style, use meaningful variable names, and comment your source code where appropriate; (5) You must use the provided source code template (it contains helpful comments that can help you structure your code); and (6) You must submit your source code as a single .py file. The formula for compound interest is A=P(1+) where A is the final Amount, P is the initial amount, r is the percentage interest rate, and t is the number of years. 100
Step by Step Solution
3.52 Rating (159 Votes )
There are 3 Steps involved in it
def getname name inputPlease enter your name return ... View full answer
Get step-by-step solutions from verified subject matter experts
