Answer:
m = 8 and b = 3 OR m = 15 and b = 0
Explanation:
Note that the conditions on this problem could be contradictory (they are likely not, but could be)
let m be the number of magazines bought
let b be the number of books, then
3m is the cost of the magazines bought and
7b is the cost of the books bought, since $45 exactly must be spent then
3m + 7b = 45
Let us assume m = 8 and see what happens
3(8)+7b = 45
24+7b=45
7b=21
b=3, this meets the requirements and results in an integer (whole) number of books, if b had ended up as a fraction, then m=8 would have to be wrong and we would have tried m=9 , then 10, 11, 12, up to 15 if necessary until we got a whole number of books. Notice that 15 magazines and 0 books also works