Answer
See below
Work Step by Step
The friend's rate is 3 rooms per 8 hours.
So, the time $t$ your friend would take to paint the room when working alone is:
$\frac{1 room}{t}=\frac{3 rooms}{40}\\3t=40\\t=\frac{40}{3}\\t\approx13.33\\t=13 hr 20 min$