Consider a Markov-modulated G/G/1 queueing system in which the arrival and the service mechanisms are controlled by an underlying Markov chain. The classical approaches to the waiting time of this type of queueing system have severe computational difficulties. In this paper, the authors develop a numerical algorithm to calculate the moments of the waiting time based on Gong and Hu’s idea. The present numerical results show that the algorithm is powerful. A matrix recursive equation for the moments of the waiting time is also given under certain conditions.