Answer
18
Work Step by Step
Pigeonholes-38 time periods, and
Pigeons-677 classes.
By the generalized pigeonhole principle, there is some time period in which at least $\left \lceil{\frac{677}{38}}\right \rceil$ = 18 classes are meeting. Since each class must be held in a different room, we need 18 rooms.