#include "myrandom.h" myrandom::myrandom(unsigned long n) //constructor : next {n} { } unsigned long myrandom::operator()() { next *= 1103515245; next += 12345; return (next >> 16) & 0x7FFF; //Return number in bits 16-30 inclusive. }