Not quite. How you should be doing it is cutting the cost into slices, rather than doing it all in one step. So basically what yuou need to write is a program that has a maximum of four steps, and doesnt continue when one of those step is not met.
Ex. you stay 4 hours.
The first hour costs on dollar that we put in a pot. Then we subtract an hour from it.
We have 3 hours left. We add 2 dollars per hour into the old pot, then subtract 4 hours (which was the condition)
We have -1 hours left. Therefore, the next condition is impossible, and we can stop there.
From this, we concluded that 4 hours costs 7 dollars.
You can do it other ways, I just thought that sounded simple. I may be wrong
