Answer:
Part A:

Part B:

Explanation:
Part A:
We should determine the free-body diagram of the small box.
For the first box, the only force exerted to the box is the static friction force in the direction of the motion.
(The direction of the static friction is always confusing to the students. The wrong idea is that the static friction is in the opposite direction with the motion. However, if you look at the Newton's Second Law, it states that the net force acting on an object is equal to the mass times acceleration. And in this case acceleration of the total system is equal to that of the small box, since it sits on the larger box.)
We can use the equations of kinematics to find the minimum distance to stop without the small box slipping.

The acceleration can be found by Newton's Second Law:

The negative sign comes from the fact that in order for the boxes to stop they have to apply a negative acceleration.
Now, we can combine the two equations to find the distance x:

Part B:
We can apply the above formula to the truck and file cabinet.
