Today, I got a problem that is similar to what I presented last week, on the surface. It’s another example of why understanding the problem is the biggest part of solving it. You can see the problem that I was sent here:

In this case, because it’s not cumulative, we can basically do a simple nested if condition. Basically, for any consumer that has over 200 units consumed, we know the exact cost of those 200 (100 at $0.54 and 100 at $0.75). The same is true for those that have over 100. So I started off by calculating those 2 amounts: