Home /
Expert Answers /
Computer Science /
can-you-solve-this-question-thanks-write-a-c-program-to-implement-non-repeating-random-number-gener-pa536
(Solved): Can you solve this question thanks. Write a C program to implement non-repeating random number gener ...
Can you solve this question thanks.
Write a C program to implement non-repeating random number generator. The program uses three parameters, upper and lower limits of the random numbers (i. int upper, lower) and the number of items that are generated via the program (i.e NOGN). Also, record the random number generation process to a file. The content of the file must be same with the content given Figure 1.
An example is given in Figure 2. In the figure, lower and upper limits are selected 10 and 20 , respectively. So, you have to add items to a linked list starting from 10 and ending with 20 . Then NOGN is selected 5 . Thus, the size of the numbers array must be 5 . First position is 9 and the 9 th item in the list is 18 (Remember that position is started from 1 ). Then, 18 is added to numbers array and it is deleted from the list by using "erase" function. The next position is 8 and the 8th item in the list is 17 . Then, 17 is added to numbers array and it is deleted from the list by using erase function. The procedure is repeated 5 times. Figure 2 . An example terminal screen for non-repeating random number generator.