Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the principal, interest rate and yearly payments are to be provided as inputs. only one payment can be made every year and the yearly balance

the principal, interest rate and yearly payments are to be provided as inputs. only one payment can be made every year and the yearly balance should be displayed before processing the yearly payment. The interest rate is applied yearly to the loan balance after the yearly payment is made. I keep getting this output when i run this program. I need the current loan balance to decrease every year, not increase. For example, i enter 14000000 as the principal, interest rate as 0.04 and then the current balance should be 1400000.0. Then i enter the yearly payment as 200000, then the current balance should be 1248000.0, after i enter the yearly payment as 248000, the loan balance should be 1040000.0, then i enter the yearly payment as 500000, the current loan balance should be 561600.0, i enter 500000 as the yearly payment again and now the current loan balance is 64064.0, then i enter the yearly payment as 64064. So the number of years needed to pay off the loan is 5. How can i get this program to look like the output in the image I gave below?
I dont need to initalize anything in this program. The principal, interest rate and yearly payment should be provided as inputs, as well as the current loan balance should be displayed before processing the yearly payment. The output should look exactly like the one in the image when I run the program. The expected input/output behavior of the program is illustrated below for one example input:
Enter principal: $14000000
Enter interest rate: 0.04
Current loan balance: $1400000.0
Enter yearly payment: $200000
Current loan balance: $1248000.0
Enter yearly payment: $248000
Current loan balance: $1040000.0
Enter yearly payment: $500000
Current loan balance: $561600.0
Enter yearly payment: $500000
Current loan balance: $64064.0
Enter yearly payment: $64064
Number of years needed to fully pay the loan: 5
image text in transcribed

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

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions