Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#################################################### Please note that we have to add amount 100 into the account every month instead of only 100 from the begging to the end.

####################################################

Please note that we have to add amount 100 into the account every month instead of only 100 from the begging to the end.

THANK YOU !!!! Please use while loop instead of for loop

image text in transcribedimage text in transcribed

Applications : Continuously Compounded Interest Suppose we decide to invest some money in an account that continously compounds interest. In other words, the amount that we initially invested is constantly earning interest and any interest that we earned also keeps acquiring interest. At first, let's compute our earnings in the short term. Suppose you save $100 each month into a savings account that has an annual interest rate of 5%. So, the monthly interest rate is 0.05/12 = 0.00417. After the first month, the value in the account becomes 100 *(1 +0.00417) = 100.417 After the second month, the value in the account becomes (100 + 100.417) *(1+0.00417) = 201.252 After the third month, the value in the account becomes (100 + 201.252) * (1 +0.00417) = 302.507 and so on. Before you begin writing any code, try writing out the pseudocode for your function. Think about how you would calculate the compound interest if you did the math by hand and use this to help you in the implementation. Write a function savings that computes and returns the savings amount after the given month, given a monthly contribution amount (e.g., 100), the annual interest rate (e.g., 5), and the number of months (e.g., 6), Use the while loop to implement this function. def savings (amount, interest rate, months): Given a monthly contribution amount (e.g., 100), the annual interest rate (e.g., 5), and the number of months (e.g., 6), returns the savings amount after the given month. return "stub" # TODO: replace return "stub" with a correct return statement

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions