An iterative algorithm is developed for computing numerically the stationary queue length distributions in M/G/1/N queues with arbitrary state-dependent arrivals, or simply M(k)/G/1/N queues. The only input requirement is the Laplace-Stieltjes transform of the service time distribution. In addition, the algorithm can also be used to obtain the stationary queue length distributions in GI/M/1/N queues with state-dependent services, or GI/M(k)/1/N, after establishing a relationship between the stationary queue length distributions in GI/M(k)/1/N and M(k)/G/1/N+1 queues. Finally, the paper elaborates on some of the well studied special cases, such as M/G/1/N queues, M/G/1/N queues with distinct arrival rates (which includes the machine interference problems), and GI/M/C/N queues. The discussions lead to a simplified algorithm for each of the three cases.