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