diff --git a/Compound Interest/Problem.txt b/Compound Interest/Problem.txt new file mode 100644 index 0000000..a81048e --- /dev/null +++ b/Compound Interest/Problem.txt @@ -0,0 +1,7 @@ +A person invests 1000.00 in a savings account yeilding 5 percent interest. Assuming that all interest is left on deposit in the account, calculate and print the amount of money in the account at the end of each year for 10 years. Use the following formula for determining these amounts: +a = p(1+r)^n +where +p is original amount invested (principal) +r is the annual interest rate +n is the number of years +a is the amount on deposit at the end of n years \ No newline at end of file diff --git a/Compound Interest/Solution.cpp b/Compound Interest/Solution.cpp new file mode 100644 index 0000000..e182ffc --- /dev/null +++ b/Compound Interest/Solution.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +using namespace std; + +int main() +{ + double amount; + double p = 1000.0; + double r = .05; + + cout <<" Year: " << setw(21) <<" Deposit amount"<