Get Instant Help From 5000+ Experts For

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
Python Compound Interest Calculation with Loops

Coding Requirements

You coded a program using the formula below to compute what the money will be worth at the end of the term.  A sample output solution is given below. Compound interest arises when interest is added to the principle, so that from that moment on, the interest that has been added also itself earns interest. This addition of interest to the principal is called compounding. A bank account, for example, may have its interest compounded every year: in this case, an account with $1000 initial principal and 20% interest per year would have a balance of $1200 at the end of the first year, $1440 at the end of the second year, and so on.  

You will create a Python program that allows for the numeric entry of Deposit, Interest Rate Percentage and Number of Months.  You will calculate the interest for each month the deposit is to be in the saving account.

The power of compounded interest is your money will grow faster.  For this assignment you will be coding a special feature to determine how many months it will take for your original investment to reach your saving goal. 

1. Prompt the user for these required input values:  Deposit, Interest Rate Percentageand Number of Months, and Goal. Make sure to select the appropriate data type for each.

2. Perform data validation on the Deposit, Interest Rate Percentageand Number of Months, and Goal are numeric using Python error handling which can be found in Blackboard.  Use Python’s loops to accomplish the three sub-tasks below:

-If the contents are not numeric issue a message and prompt them again until the user enters a valid number for each of the input variables.  

-Make sure Deposit, Interest Rate Percentageand Number of Month are non-zero and positive values or issue an error message and ask for input again.  

-The Goalamount can be 0 but not negative.  If negative issue an error message and ask for input again.  

3. Convert Interest Rate Percentageinputted value to a decimal variable and then divide the  interest rate decimal value by 12 to get a monthly interest rate.   For example 0.04 / 12 = 0.0033. This newly computed value is the Monthly Interest Rate.

4. Code a loop to execute up to the Number of Months variable value the user has supplied to compound the interest rate.  You can choose a while or for loop.

-Multiply the Depositby the Monthly Interest Rate that was determined above to get the interest for the month.

-Add the interest for the month to the Deposit to get the new Account Balance

-Output the Month Numberand the new Account Balance (formatted as currency) to the screen

-Repeat the loop until the number of months has been met.

5. Code another loop to predict how many months it will take of compounding to reach your Goal  Note: You shouldn’t use a for loop because you don’t know how many months it will take):

-Keep track of how many times you are through the loop.  This will represent the number of months to reach your goal.

-Use the same logic you coded in Step 4 to compute each month’s Compounded Savings Accountbalance but do not output anything at this point.

-Compare the Compounded Savings Accountto what the Goal  Keep executing if the Compounded Savings Account is less than the Goal amount.

-Once you reach the Goalamount format the number of months with thousands separator and output the results.

-Make sure you use Hungarian Notation when naming the variables.

-Make sure to include comments in your code.



sales chat
sales chat