As Norm says you haven stated what problems your having.

But looking through your code - I would have another "else if" statement for numberofbooks == 4, and then have another else as an invalid...