this is an easy c++ assignment, you are suppose to code a simple program. everything you need is gonna be in the attached files
Homework #1—Financial Freedom
Instructor:
Besides computer science , one of the most important things in life that you can learn about is
personal finance. Just like building a house, you must build it from the ground up. Without a
strong foundation, it may not last. As such, you need to a strong financial foundation by first
having proper protection, then a solid debt management plan, followed by an emergency fund for
the unexpected, and finally a strategy for saving and investing in order to build wealth not only
for retirement, but also to possibly hand down to your future generations.
Saving/Investing
Emergency Fund
Debt Management Plan
Proper Protection (e.g., Insurance)
Since most of you are very early in your lives and focused mostly on your academic pursuits,
learning about personal finance and developing sound strategies now may not be something that
you think about let alone concentrate on. This is a huge mistake!
Now is the best (and easiest) time to do it. First, insurance is easier to get when you are young
and healthy (remember this!). Second, implementing good debt management plans now when
you have only a few burdens will create habits that will be benefit you for the rest of your life.
Third, having that emergency fund will give you the peace of mind that you may not have to go
into debt when the unexpected happens (which it will…often!). Finally, establishing a routine of
saving for your future and investing will not only help you enjoy a long and relaxed retirement,
but it will also help generate wealth by allowing your money to make money over time, which is
the most powerful thing you all have. This last concept will be the focus of this homework
exercise.
The “time value of money” as it is often referred to cites the wonderful benefits of saving and
investing over the long term due to the effects of compound interest. The longer the time period,
the greater the returns.
Note: For many years, to lend credence to this notion, people erroneously cited that Albert
Einstein once said, “Compound interest is the eighth wonder of the world. He who
understands it, earns it…he who doesn’t…pays it.” While there is no real proof he did or
did not say such a thing, it does not change the fact that understanding the concept of
compound interest is extremely valuable, especially when you are young and have lots of
time on your side!
One of the most common mathematical formulas for computing compound interest is as follows:
(P + 1) = Pert
Where Pis principle, I is interest, ris interest rate (in years), and tis time (in years). The lettere
is a mathematical constant, which is the base of the natural logarithm.
Page 1 of 4
Homework #1-Financial Freedom
Instructor:
This formula assumes that the interest compounds “continuously” (e.g., versus daily, weekly,
monthly, or yearly). This means that interest earns interest as soon as it is produced. It turns out
that compounding continuously versus daily are pretty close unless the principle is really huge.
As you will likely come across in your calculus or higher-level math classes, e is an irrational
number that is obtained by taking the limit of for n = 0 to infinity.
n!
Σ,
1
e =
=
n!
n=0
0! 1! *27+
1 1 1 1
+
… = 2.718281828459045 …
2!
*3!
Note: e is the inverse of the natural logarithm (In). As such, solving for t when your money
doubles is actually very easy. This means that (P+1) = 2P. Substituting in the Pert
equation, you get:
(P + 1) = Pert
(2P) = Pert
2P
Fert
–
Р
2 = ert
In(2) = In(ert)
In(2) = rt
In(2)
= t
r
Alternatively (but a little less common), if you want to solve for the rate (T) you would need for
your money to double when you know the time (t), simply swap t& r.
In(2)
=r
t
Go ahead and use your calculator to solve for In(2), and you will get 0.69314718. In C++, you
can use log (2) [the space after the word log is optional] as a term in an assignment to calculate
the value of the natural log of 2. Do not get confused, as you may have learned logarithms
where log to base 10 was written log (x).
In addition, to save you time, here is how to use the power function in C++:
pow (base, exponent)
As such, pow (3, 4) would be 3 raised to the 4th power, which would return 81.
Page 2 of 4
Homework #1-Financial Freedom
Instructor:
Now that you are totally freaked out (do not worry, it is not difficult)…for this homework
assignment, I want you to write a C++ program that accomplishes the following:
1. Request the user’s first and last name and age (a decimal value for age should be OK).
2. Request from the user an amount to invest/save (e.g., the principle).
3. Request from the user an expected annual rate of return (e.g., the rate).
4. Display the user’s full name and how much money he/she will have in 10 years.
5. Display a blank line and then how old the user will be when his/her investment doubles.
6. Display a blank line and then show how much the investment will be worth when he/she
is 65 years old, which is perhaps when he/she is ready for retirement.
For this assignment, you may work with one partner. If you choose to do so, please be sure to
include both of your names and the last four digits of your respective CWID numbers in the
comments of your code at the top. Be sure to use self-defining variables, comments, and
structure (e.g., indent) your code effectively and efficiently.
Before you write a single line of code, however, I want you to produce fairly detailed
pseudocode (not every single line, but your entire algorithm), which you can handwrite and take
a photograph of to be included in your final report (you can insert the photo into your Word
document).
You will include your source code as part of your report. You may wish to use the following
code to format your dollar amounts with commas (for easy reading) and with fixed precision of
two digits to the right of the decimal place:
#include