It's the first time to buy a book of1200/x.
The second wholesale price is (1+20%) x.
Then I bought 1500/ (1+20%)X books for the second time.
Then (1+20%) x+10 =1500/(1+20%) x
The solution is X=5.
First profit 1200/5 times (7-5)=480.
Secondary wholesale price (1+20%)X=6.
Second book purchase: 1500/ 6 =250.
The second profit is 200 times (7-6)+(250-200)(7 times 40%-6)=40.
Then the two total profits are 480+40=520.
That is, overall earning 520 yuan.