In this problem, we know that:
- An agent sold a house for $311,000 at a real estate agency.
- The commission rate is 4.5% for the real estate agency.
- The commission rate for the agent is 30% of the amount the real estate agency gets.
So the questions are two.
Let's name:

We can compute the commission rate of the agency as follows:

The commission rate for the agent is 30% of the amount the real estate agency gets, so:

Therefore, The total amount of money the agency gets is:

_____________________________________
Finally, to sum up:
Q1. How much did the agency make on the house?
The agency makes $9796.5
Q2. How much did the agent earn in commission?
The agent earns in commission $4198.5