Two angles are said to be supplementary if their sum is 180 degrees. So, if x and y are supplementary angles, the formula is

We know that one of the angles (say x) is 98. So, the equation updates to

If we want to solve for the other angle, we can simply subtract 98 from both sides to get

AB = 30 in and BC = 50 in.
We use Pythagorean theorem to solve this. Since AN is an altitude, this means that it is perpendicular to BC. This means BN and AN are the legs of one right triangle, with AB being the hypotenuse:
18²+24² = AB²
324 + 576 = AB²
900 = AB²
Take the square root of both sides:
√900 = √AB²
30 = AB
NC and AN form the legs of the other right triangle, with AC being the hypotenuse:
24²+NC² = 40²
576 + NC² = 1600
Subtract 576 from both sides:
576 + NC² - 576 = 1600 - 576
NC² = 1024
Take the square root of both sides:
√NC² = √1024
NC = 32
BC = BN + NC = 18 + 32 = 50