Notice that angle B corresponds to one of the interior angles of triangle ADB and triangle CAB, since both triangles are right triangles, then by AA criterion

Now, we are given that the length of segment AC is 8 units and the length of segment AB is 10 units, since the triangles are right triangles, from the Pythagorean theorem we get that:

Solving the above equation for BC, we get:

Therefore:

( u = units).
To find the length of CD, we will use the trigonometric function cosine:

Finally, we get that:

Answer:
a)

b)
