00:02
Hello, for this problem we're trying to figure out how much money we need to make in sales to get $30 ,000 earnings.
00:10
So let's set up some variables.
00:13
We'll go ahead and say sales is equal to 0 .0 and we'll say our earnings is equal to i'm just going to start with a single penny and then what we want to do is just keep increasing earnings calculate how much or keep increasing sales figure out what that does to our earnings and as soon as we get our earnings of $30 ,000 we know that we're there.
00:42
So this is going to be a while loop.
00:44
So while earnings are less than $30 ,000, make sure we have all the zeros in there, i do.
00:57
And so what we're going to do now is first of all, we're going to increase.
01:03
Sales and i'm just going to increment sales by a penny at a time and so it's not going to be very efficient the best way to do this is just solve it as a math problem but we'll just do it penny at a time until we get bigger than 6 ,000 and then we have three different rates for the the commission so if the sales are less than are equal to 5 ,000 then the rate is going to be equal to 8%.
01:46
And then we'll do an lf or else if sales are less than or equal to 5 ,000.
01:59
No, no, that was 5 ,000.
02:01
This is 10 ,000.
02:07
Then the rate is equal to 10%.
02:13
And if it's more than that, so we can use an else statement, the rate is equal to 12%...