Hello, thank you for taking the time to post your question!
The underlying equation that you want to solve here is
3x + 4y = 15 , where “x” represents the number of 3 credit hour courses and “y” represents the number of 4 credit hour courses
The two combinations that allow that to work are
x = 5, y = 0 … meaning 5 3-credit hour classes and 0 4-credit hour: 3(5) + 4(0) = 15
x = 1, y = 3 … meaning 1 3-credit hour class and 3 4-credit hour classes: 3(1) + 4(3) = 15
I hope that helps you get moving in a better direction on this type of question! Feel free to reach out if you have any additional questions beyond that :)