We know there are 48 courses in all, "x" worth 3 credits and (48-x) worth four credits. Note that we need only one variable.
3x + 4 * (48-x) = 155
3x + 4 * (48-x) = 155
3x + 192 - 4x = 155
x = 37
So there are 37 3-credit courses and 11 (48-37) 4-credit courses.
Check: 37*3 + 11*4 = 111 + 44 = 155
So there are 37 3-credit courses and 11 (48-37) 4-credit courses.
Check: 37*3 + 11*4 = 111 + 44 = 155