Since you are given x and y components of the velocity vector, and, I presume, of Q, use the "projection" of the velocity vector on the wall. The projection parallel to the wall does not change while the projection perpendicular to the wall changes sign.

Since the given Q is itself perpendicular to the wall, the projection parallel to Q changes sign and the projection perpendicular to the wall does not change. Do you know how to find projections? If you drop a perpendicular from vector V to vector Q, you form a right triangle with hypotenuse V and "near side" the length of the projection of V on Q- calling the projection vector P, |P|/|V|= cos(\theta) where \theta is the angle between the vectors, so |P|= |V|cos(\theta). But Q\cdot V= |Q||V|cos(\theta) so |P|= Q\cdot V/|Q|. A vector in the direction of Q with length 1 is Q/|Q| so the projection vector itself is (Q\cdot V/|Q|^2)Q. Of course, the vector perpendicular to Q is V minus that: V- (Q\cdot V/|Q|^2) Q.

So V reflected off a wall perpendicular to vector Q is parallel projection minus perpendicular projection: (Q\cdot V/|Q|^2)Q- (V- (Q\cdot V/|Q|^2)Q)= 2(Q\cdot V/|Q|^2)Q- V.