00:03
Okay, let's like this time.
00:05
We have a scenario and we're going to want to come out with our design.
00:12
Suppose you save $100 each month into a savings account so you make a deposit every single month.
00:18
Oh wow, the annual interest rate for that savings account is 5%.
00:22
You would think that the bank would want to take much more from that.
00:32
Let's see.
00:35
And then they tell us the monthly interest rate they calculate for us as zero point.
00:39
04017 with that interest rate.
00:42
And then they show us after the first month, the value becomes this, after the second month, the value becomes that, and after the third month, the value becomes that, and so on.
00:54
So then they want us to write a program that prompts the user to enter a monthly savings and displays the account value after the six month.
01:03
Well, we can do that, right? let's see.
01:07
We can actually do a little math.
01:09
Well, let's see.
01:10
We're going to calculate the amount value after this.
01:27
It could be used math to come up with a clean formula.
01:30
That would work in one go.
01:31
But i'll leave that for you to play around us.
01:35
It would make this code a little shorter.
01:38
It would be a lot shorter.
01:40
But let's see.
01:43
We'll go just regularly, hard quoting it.
01:50
The value of the compound being and deposit described.
02:05
First, we're going to just calculate the value and display to the user.
02:16
You give a sample actually, that's great.
02:19
It looks like the sample says we're going to enter a monthly savings about.
02:25
Okay, so there's a third step.
02:27
The very first thing we're going to do is prompt the user for a monthly savings amount.
02:32
If they want to enter 100 a month, that's great.
02:40
Savings, that's going to be equal to.
02:50
We're going to get input from the console, but we need to evaluate into an numeric type to do calculations on it in the next step and ask them to enter the monthly savings amount.
03:06
We'll do a calculation and then display to the user through the console.
03:11
After the sixth month, let's see the account value is, and then we'll pass in the end amount here.
03:36
Let's actually calculate it.
03:38
Well, after the first month, we're just taking that initial savings and multiply.
03:43
It by 1 plus our interest rate.
03:47
Remember they hardcoded the interest rate for us being, let's see, rate is equal to per month, 0 .00417.
04:00
Let's see.
04:02
For each month, we're going to be multiplying by 1 plus that rate.
04:07
Why don't we just write the monthly compound vector as 1 plus the rate? that's a bit too long.
04:29
Let's just call it growth...