This preview shows pages 1–2. Sign up to view the full content.
ECE 231 – Fall 2010
Programming Assignment 2
Due: Tuesday, September 7, 2010 at 11:59 PM
Write a C++ program that based on a menu choice either calculates an amount you have gained
in an account using the compound interest formula given a principle, interest rate, the number of
compounds per year and the number of years or the continuous compounding formula that
requires the principal, interest rate and number of years or exits.
The formulas you will use are described as follows:
nt
n
r
P
A
+
=
1
where A is amount, P is principle, r is interest rate (in decimal form,) n is the
number of compounds per year (annually would be 1, monthly would be 12, etc,) and t is time in
years (one and a half years would be 1.5.)
For this calculation, you will need to ask the user to
enter the principle, the interest rate, the time and the number of compounds per year.
rt
Pe
A
=
where A is amount, P is principle, r is interest rate (in decimal form,) and t is time in
years.
For this calculation, you will need to ask for the principle, the interest and the time.
NOTE
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 04/03/2012 for the course ECE 231 taught by Professor Peralta,s during the Fall '08 term at New Mexico.
 Fall '08
 Peralta,S

Click to edit the document details