Johnny has two bank accounts. One pays 7% interest and the other pays 10% interest. A total of $25,000 invested in the two accounts. Last year he earned $2,200 in interest on two accounts. How much money does he have in each account? define variables and write out a system of equation!

To solve this problem, let's define the following variables:

Let's say the amount of money Johnny has in the bank account that pays 7% interest is "x".
Similarly, let's say the amount of money he has in the bank account that pays 10% interest is "y".

Now we can create a system of equations based on the given information:

Equation 1: The total amount of money Johnny has is $25,000.
x + y = 25,000

Equation 2: The total interest earned from the two accounts is $2,200.
0.07x + 0.10y = 2,200

Now we have a system of equations:

Equation 1: x + y = 25,000
Equation 2: 0.07x + 0.10y = 2,200

To find the values of x and y, which represent the amounts of money in each account, we can solve this system of equations.