For both problems, we'll set up equations that help to solve problems dealing with similarity.
For the first one, we can write 50/40 = x/4 (we set this up in the ratio height:shadow). This simplifies to 200 = 40x, which simplifies to x=5 (using the Division Property of Equality).
For the second one, we can do the same thing. We'll set up a ratio for the longest and shortest sides (longest:shortest). This will become 6/8 = 3/x, which simplifies to 6x = 24, which becomes x=4.
So your answers are 5 feet, and 4 (units).
:)