Let us suppose they charge $x for hardcover books and $y for paperbacks..
According to question:
4x+10y=64.........................1 and
5x+7y=58.................2
We have a linear equations with two variables.We can use Elimination method to solve for x and y.Multiplying equation 1 by 5 and equation 2 by 4 we have:
20x+50y=320.
10x+28y=232
- - -
..............................
22y =88
Dividing both sides by 22 y=4.
we replace variable y in the first equation :
4x+10*4=64
4x+40=64.
Subtracting 40 both sides:
4x=24
Dividing by 4 both sides x=6.
Total charge for hardcovers is 5x+4x=9x=9x6=$54.
Total charge for paperbacks is =7y+10y=17y=17(4)=$68.