In the first period 18 books were non-fiction out of 40 books. In percentaje, we have that
[tex]\begin{gathered} 40\text{ books ----- 100 \%} \\ 18\text{ books ------ x} \end{gathered}[/tex]and x is given by
[tex]\begin{gathered} x=\frac{(18)(100)}{40} \\ x=\frac{1800}{40} \\ x=45\text{ \%} \end{gathered}[/tex]that is, 18 non-fiction books correspond to 45% of 40 books.
With this result, we can expected that 45% of 100 students prefer non-fiction books. That is
[tex]100\times45\text{ \%=100}\times0.45=45\text{ students}[/tex]that is, 45 students check out non fiction books.