Final answer:
Justin had $5000 in the first account and $4700 in the second account.
Step-by-step explanation:
Let's assume that the amount of money Justin invested in the first account is x, and the amount he invested in the second account is y.
According to the problem, the interest earned from the first account with a 3% interest rate is 0.03x, and the interest earned from the second account with a 2% interest rate is 0.02y.
Therefore, we can set up the following two equations:
0.03x + 0.02y = 232 (equation 1)
x + y = 9700 (equation 2)
Solving these equations simultaneously, we can find the values of x and y. After calculating, we get x = 5000 and y = 4700.
So, the amount in the first account is $5000, and the amount in the second account is $4700.