A university student completed courses worth 3 credits and some courses worth 4 credits. The student earned a total of 54 credits after completing 15 courses. How many courses worth 4 credits did the student complete?

A. 9
B. 6
C. 20
D. 32

Let x be the number of courses worth 3 credits and y be the number of courses worth 4 credits.

We know that x + y = 15 and 3x + 4y = 54.
We can solve for x by subtracting y from both sides of the first equation: x = 15 - y.
Substituting this into the second equation, we get 3(15 - y) + 4y = 54.
Expanding the equation, we get 45 - 3y + 4y = 54.
Combining like terms, we get y = 9.
Therefore, the student completed 9 courses worth 4 credits.
The answer is A.