Design a number (ID) generator system that generates numbers between 0-99999999 (8-digits). The system should support two

Question:

Design a number (ID) generator system that generates numbers between 0-99999999 (8-digits).

The system should support two functions:

a. int getNumber();

b. boolean requestNumber();

getNumber() function should find out a number that is not assigned, then mark it as assigned and return that number. requestNumber()

function checks the number if it is assigned or not. If it is assigned returns false, else marks it as assigned and return true.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: