Can anyone help me with these two algebra problems??

1.) A broker made 2 seperate investments on behalf of a client. The first investment earned 12% and the second lost 5% for a total gain of $1040. If the amounts in these two investments had been switched then the result would have been a gain of $360. Determine how much was actually invested at each rate

2.) While it is a common knowledge that Martians are green and have seven heads, few people realize that a Martian has eleven eyes. At a recent party, while I was conversing with a Martian, I innocently remarked that if one-half of the Martians at the party suddenly became Earthlings (while the other half remained Martians), there would be 295 eyes at the party. Somewhat offended, the Martian noted that if one-half of theEarthlings at the party became Martians (while the other half stayed Earthlings), there would be 410 heads at the party. How many Martians and how many Earthlings were at

the party?

ANS: This is what me and my friend worked out, but the red bolded parts is the parts i dont know how my friend go it.

let x = number of martians

y = number of earthling

eyes

295 = (x/2)*11+ (x/2)*2 + 2y <----where did those numbers come from

295 = 13x/2 + 2y

590 = 13x + 4y

heads

410 = (y/2)*1+ (y/2)*7 + 7x <----and these numbers??

410 = 4y + 7x