Question

In: Computer Science

Assuming there are no deposits other than the original investment, the balance in a savings account...

Assuming there are no deposits other than the original investment, the balance in a

savings account after one year may be calculated as

                             Amount = Principal *(1 + Rate/T)^T

Principal is the original investment in the savings account,

Rate is the annual interest rate, and T is the number of times the interest is

compounded during a year ( T is 4 if the interest iscompounded quarterly).

NOTE: the periodic rate r in the expression (1 + r) must match the duration of the period.

That is, a monthly period must use a monthly rate. When Rate is expressed as an Annual Percentage Rate (APR), then a monthy rate r is Rate/12.

  

Write a program that asks for the principal, the interest rate, and the number of times

the interest is compounded. It should display a formatted report similar to

Interest Rate: 4.25%

Times Compounded: 12

Principal: $ 1000.00

Interest: $ 43.34

Amount in Savings: $ 1043.34

Display your interactive dialog with the console

RUN THE FOLLOWING TEST CASES:

1) $ 5000 at 7.5% compounded 4 times.

2) $ 7500 at 5.2 % compounded 12 times.

3) $ 1000 at 10 % compounded(daily) 360 times.

Quality of craftsmanship is part of the grading.

Solutions

Expert Solution

C++ Program:

#include<iostream>
//For calculating power
#include<math.h>
//For rounding to 2 decimal places
#include<iomanip>
using namespace std;
int main(){
float principal,interest_rate,amount,interest;
int numberoftimes;
cout<<"Enter the principal:";
cin>>principal;
cout<<"Enter the interest rate:";
cin>>interest_rate;
cout<<"Enter the number of times interest is compounded:";
cin>>numberoftimes;
//Interest rate is converted into decimal by dividing with 100
amount = principal * pow((1+((interest_rate/100)/(numberoftimes))),numberoftimes);
interest = amount - principal;
cout<<fixed<<setprecision(2)<<"Interest Rate: "<<interest_rate<<"%\n";
cout<<"Times Compounded: "<<numberoftimes<<"\n";
cout<<fixed<<setprecision(2)<<"Principal: $ "<<principal<<"\n";
cout<<fixed<<setprecision(2)<<"Interest: $ "<<interest<<"\n";
cout<<fixed<<setprecision(2)<<"Amount in Savings: $ "<<amount<<"\n";
return 0;
}

Output:


Related Solutions

Today, you open a new savings account and deposit $3,000. No other deposits or withdrawals are...
Today, you open a new savings account and deposit $3,000. No other deposits or withdrawals are made to your account. Assume you will earn 4% simple interest per year. How much will your investment be worth in 25 years?
Today, you open a new savings account and deposit $3,000. No other deposits or withdrawals are...
Today, you open a new savings account and deposit $3,000. No other deposits or withdrawals are made to your account. Assume you will earn 4% simple interest per year. How much will your investment be worth in 25 years
Today, you open a new savings account and deposit $3,000. No other deposits or withdrawals are...
Today, you open a new savings account and deposit $3,000. No other deposits or withdrawals are made to your account. Assume you will earn 4% simple interest per year. How much will your investment be worth in 25 years?
Jody's grandparents deposited $1,200 annually to a savings account and increased the deposits at a rate...
Jody's grandparents deposited $1,200 annually to a savings account and increased the deposits at a rate of 3% annually for 5 years. What is the present value of this investment earning 8% annually?
a) Your favorite aunt opens a savings account on your name and deposits $10,000 at the...
a) Your favorite aunt opens a savings account on your name and deposits $10,000 at the end of each year for 10 years. The account earns an interest rate of 2.2%. After the final deposit, you move the accumulated savings to your brokerage account and invest in the stock market, where they earn an average return of 5.8% for the following 23 years. How much will you have in your account at the end? Round to the nearest cent. b)...
A person deposits $100 per month into a savings account for 2 years. If $75 is...
A person deposits $100 per month into a savings account for 2 years. If $75 is withdrawn in months 5, 7 and 8 (in addition to the deposits), construct the cash flow diagram to determine how much will be in the account after 2 years at i = 6% per year, compounded quarterly. Assume there is interperiod interest
Mary made five annual deposits of $8000 in a savings account that pays interest at a...
Mary made five annual deposits of $8000 in a savings account that pays interest at a rate of 6% per year. One year after making the last deposit, the interest rate changed to 15% per year. Five years after the last deposit, how much accumulated money can she withdraw from the account?draw the cash flow diagram.
A) Assume that you wish to make annual deposits into a savings account. The interest rate...
A) Assume that you wish to make annual deposits into a savings account. The interest rate offered by the bank is 11%, and you plan to save for the next 12 years. If your goal is for the present value of your savings to be equal to $4,058, how much money must you deposit every year? B) Assume you've just received a bonus at work of $3,812. You deposit that money in the bank today, where it will earn interest...
1.When private savings is less than private investment, we will see a A. Capital account surplus...
1.When private savings is less than private investment, we will see a A. Capital account surplus B. Current account surplus C. Cannot tell D. Current account deficit 2.Over the past year, the South African Rand has depreciated against the U.S. dollar by 5%. Furthermore, the inflation in the U.S. was at 4% over the year while the inflation in South Africa stood at 7% over the year. A. The U.S. exporters to South Africa have lost their competitive advantage relative...
Today, you open a new savings account and deposit $5,000. Noother deposits or withdrawals are...
Today, you open a new savings account and deposit $5,000. No other deposits or withdrawals are made to your account. Assume you will earn a 3% simple interest per year. How much will your investment be worth in 20 years?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT