You have some difficulties to describe things. How old are you? Are you older than 10 years old? Ask your parents to help you to write down
(1) What is your question? What is your expected result of which method. Or you did not even get any result, you got an error message, then, what is the error message you saw?
(2) Both method IsLegal() and containsJQK() are using a global variable, card[], so I need to see how card[] was initialized.
(3) I need to see the callers of these two functions, so I can tell if selectedCards is well initialized.
(4) From style point of view, both methods are written very verbose. Inner loop in IsLegal() is messy. Your project is practicing Object-Oriented, while you are still struggling in control-statements. So I guess that you proceeded too quick. If so, do not to be afraid of failure. Fail sooner is a good thing for a starter.