Write a C# program to generate unique random integers. Theprogram will ask the user three things: (a)
Question:
Write a C# program to generate unique random integers. Theprogram will ask the user three things:
(a) number of random integers the user wants to generate
(b) the lower limit of the random integers (i.e. how small therandom integers can be)
(c) the upper limit of the random integers (i.e. how large therandom integers can be)
Display the random numbers generated. These numbers areall unique (i.e. No two numbers are the same). The followingis an example:
If the numbers of random integers the user want to generate isgreater than the number of possible unique integers between thespecified limits, display an error message and ask the user tore-enter his request:
In the example above, the user asks for 10 unique randomintegers in the range of 0 and 5. However, there are only 6unique integers in this range: 0, 1, 2, 3, 4 and 5. Therefore, it is impossible for the program to satisfy the user?srequest.
The user re-enter his request. The program generates alist of random integers the user asked for:
The Science And Engineering Of Materials
ISBN: 9781305076761
7th Edition
Authors: Donald R. Askeland, Wendelin J. Wright