Each shelf of a bookcase contains 24 books. If the librarian took out 42 books and rearranged the remaining books so that all shelves but the last one contained 16 books and the last shelf contained 22 books, how many shelves does the bookcase have?	Choose the correct choice from the following choices
A) 4 B) 5 C) 6 D) 8 E) 9
Denoting x the number of the shelves, we can build an equation: 24x=16(x−1)+22+42. Solving the equation, we get x=6   Answer: 6
<result>C</result>
Each shelf of a bookcase contains 24 books. If the librarian took out 42 books and rearranged the remaining books so that all shelves but the last one contained 16 books and the last shelf contained 22 books, how many shelves does the bookcase have?