Use vn2−un1=Rn2−n1 at each end.
(a) First end (air to glass, R=+8.0 cm, u=−40 cm):
v11.5+401=8.00.5=161⇒v11.5=161−401=803⇒v1=40 cm
The rod is only 32 cm long, so the light reaches the far end while still converging, towards a point 8 cm beyond it. For the second surface (glass to air, R=−8.0 cm) this is a virtual object at u2=+8 cm:
v21−81.5=−8.01−1.5=161⇒v21=0.0625+0.1875=0.25⇒v2=4.0 cm
The real image is 4.0 cm beyond the far end.

(b) First end, with u=−24 cm:
v11.5=161−241=481⇒v1=72 cm
This point is 72−32=40 cm beyond the far end, so the light reaches the second surface while still converging. It is a virtual object there, with u2=+40 cm:
v21−401.5=161⇒v21=0.0625+0.0375=0.100⇒v2=10 cm
The real image is 10 cm beyond the far end. Moving the object closer to the rod (from 40 cm to 24 cm) moves the final image farther from the far end, from 4.0 cm to 10 cm, just as with a single lens.