Let the cost of one book= x cents
Let the money john have= y cents
According to the question,
45x=y ...eq(1)
(45+5)(x-5)=y
50(x-5)=y
50x-250=y ...eq(2)
On subtracting (1) from (2).
(50x-250)-45x=y-y
5x-250=0
x=250/5
x=50
Thus, cost of each book is 50 cents and john has 2250 cents.
Hope it helps.
Don't feel shy in saying thx if it helps.