In both
(a) and (b), the foul counts toward disqualification and it counts as one of the seven team fouls to reach the bonus.
In (b), a technical foul is also charged indirectly to Team A’s head coach resulting in the loss of coaching-box privileges.