Home / Expert Answers / Computer Science / im-in-a-inteo-python-course-really-cool-but-not-as-intro-as-i-would-like-evidently-am-working-p-pa423

(Solved): Im in a inteo Python course - really cool -but not as intro as i would like evidently. Am working p ...



Im in a inteo Python course - really cool -but not as intro as i would like evidently. Am working pretty hard at- but stuck on a question that asks foriterations/ For loops calculating compound interest on some investment. Top is what i have so far but it is not correct/working. Bottom pic are the crteria for the python program. HELP!!

student submitted image, transcription available below
student submitted image, transcription available below
Name: Jeffe, Hostiviii Date: float(input("Please enter the starting balance, ")) float(input("Enter the annual percentage rate(APR); ")) APRdec round APR/100), 2) int(input("Please enter the number of years of the investment, ")) int(input("Enter the number of compunding payments per year, )) beginning_balance Interest_earned APRdec/ - beginning_balance Ending_balance = (Interest_earned + beginning_balance) print("Beginning Balance | Interest Earned I Ending Balance") print for 1 in range : interest_earned APRdec/ - beginning_balance ending_bal = beginning_balance + interest_earned print .rjust , njust '†f'S\{ending bal:, 2 While this program is not really a data science task, it does give you one of the many purposes of the FOR loop, in this case, generating table of data. As each iteration of the loop proceeds, you build on the previous iteration, in this case you are accumulating interest of an investment, P. You provide the annual percentage rate, which today is maybe somewhere between 3 and 4 percent based on the federal governmnet rate. You put in the value in percent but you will need to divide that by 100 to make it a simple rate. You enter the number of years of the investment ( 5 or 10 or 20 , whatever). Then finally you provide what is the periods per year ( 1 or 4 or 12 , for annually, quarterly or monthly). The percentage rate needs to be divded by the periods in the year for the period percentage rate. The number of iterations and output lines in the tablee is the product of the years times the periods per year. Write a Python program which prompts for a beginning balance an annual percentage rate , (3) the number of years , and (4) the number of compounding periods per year . The program should output a header line, and then a table of values, where the balance at the beginning of the period, the interest earned in that period, and the ending balance are given on each line. Finally, the direct solution of the final balance, using the compound interest formula: Ending Balance You should calcuate this formula and show that your final balance is the same (a verification of your iterative calculations) The interest in a given period is given by: interest_in_a period current_balanace* (APR/n)


We have an Answer from Expert

View Expert Answer

Expert Answer



Here's a Python program that prompts for the required inputs and generates a table of values, along with the direct solution using the compound interest formula:




To use this program, simply run it and provide the required inputs when prompted. It will then display a table of values showing the balance at the beginning of each period, the interest earned in that period, and the ending balance. Additionally, it will calculate the direct solution using the compound interest formula and show that the final balance matches.


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe