Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If loan of P dollars collects compound interest at an annual effective rate of i and is repaid after t years, then the amount repaid,

If loan of P dollars collects compound interest at an annual effective rate of i and is repaid after t years, then the amount
repaid, denoted by A, is given by the formula: =(1+)
Suppose that a loan of $400 collects compound interest at an annual rate of 0.05 and is repaid after 3 years.
Write code to calculate the amount required to repay this loan by performing the following steps:
1. Create variables P, i, and t to store the relevant values for this loan.
2. Use the variables created in Step 1 above to calculate the repayment amount, storing the result in a variable A.
Round your result to 2 decimal places.
3. Print the result in a message using the format shown below, with the xxxx symbols replaced with the
appropriate value.
4. Pay careful attention to the formatting in your output. In particular, there should be a single space between the
colon and dollar sign, and there should be no spaces between the dollar sign and the amount.
Amount repaid: $xxxx
3

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

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

You have

Answered: 1 week ago