you want to relate each bit to an equation, and then go from there. this approach lets you view each factor in the (in my opinion) much easier equation format that it belongs in. like follows:
maximum of 30,000 to invest (since the question wants maximum return, we are going to do maximum investment):
A + B = 30000
comp-A good for 8% return, comp-B good for 12%:
return = .08A + .12B
atleast as much in comp-A as in comp-B:
A>= B
atleast 7000 in comp-A:
A>=7000
no more than 12000 in comp-B:
B=<12000
that will give you the following equations to work with:
A + B = 30000
return = .08A + .12B
--------------------(combine equations)
return = .08(30000 - B) + .12B
return = 2400 + .04B
---------------------(if we invest the maximum of 12000 in B)
return = 2400 + .04(12000)
return = 2880
you only need to do the above if you actually want to know the return amount. all they asked was what amount to invest in each based on her requirements. since the only real relation is that B cant be more than 12000 and A has to be more than B, that means her greatest return will automatically be 12000 in B and the rest in A. no real math needed but I did the above to show the general steps when they ask for more info.