If you know your current class average, you can calculate based on the formula
a*b + x*y = F, where
a = current grade
b = 1-Final's worth to class grade as a decimal
x = grade on Final
y = Final's worth to class grade as a decimal
F = desired grade in class
This then comes down to (F - a*b)/y = x.
To explain (this might need an example). Let's say that you have a current 87.94 and the Final is worth 25% of your grade and you are looking for an A (90). This means your values are
a = 87.94
b = .75 (25% as a decimal, .25, subtracted from 1)
x = unknown
y = .25
F = 90
You get x = (90 - (87.94*.75)/.25) = 96.18
If you do not know your current class average, the math is sort of similar, but you have something more like
F = a*b + c*d + e*f + g*h....+x*y
where each pair is the weight of the assignment times the grade in the assignment. In this case, you figure out each pair and then add them together and subtract them from F to find what is remaining to get to F, and then divide the weight of the Final into this.
x = (F - a*b = c*d...)/y
For simplicity, let's say you have 3 tests worth 15% each, homework worth 20%, and then a Final worth 35%. Given the values of
Test 1 = 73
Test 2 = 87
Test 3 = 82
Homework = 95
and Desired Grade of 80 (a B)
you have (80 - ((73*.15) + (87*.15) + (82*.15) + (95*.2)))/.35 = 70.57.
Using the same values, you would need a 99.14 to get an A (90) and anything over a 42 to get a C (70). By doing such a spread, you can get an idea of likelihood of one grade over another.
If you have unknown grades, you will need to make estimates. Haven't gotten your third test back yet? Maybe average the first two as a guess on your third, or try it at a couple of assumed values.