We present Mathematica programs that calculate algebraically the distribution moment of any order from the Pollaczek-Khinchine formula for the waiting time of an M/G/1 queue with first-come first-served discipline. Similar programs are also provided for the queue size, the length of a busy period, and the waiting time in the last-come first-served system.