Add up all your test grades so far. Then, multiply the percentage you'd like to maintain times (the number of tests you've taken plus 1).
The difference between the second thing and the first thing tells you what you need to score on the next test
For example, suppose I wanted to maintain an "80" average. So far, on two tests, I've made an 81 and a 76.
Adding the last two things, I get 157. Suppose I have one test left. Then I would multiply 80 times (2 tests taken + 1 left) = 80 (3) = 240.
Then, subtracting the first thing from the second, we get 83. And this is what I need to make on the next test to maintain an "80."
Good luck........