Question: Write a C# program to generate unique random integers. The program will ask the user three things: (a) number of random integers the user wants

Write a C# program to generate unique random integers. The program 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 the random integers can be)

(c) the upper limit of the random integers (i.e. how large the random integers can be)

Display the random numbers generated. These numbers are all unique (i.e. No two numbers are the same). The following is an example:

Write a C# program to generate unique random integers. The program will

If the numbers of random integers the user want to generate is greater than the number of possible unique integers between the specified limits, display an error message and ask the user to re-enter his request:

ask the user three things: (a) number of random integers the user

In the example above, the user asks for 10 unique random integers in the range of 0 and 5. However, there are only 6 unique integers in this range: 0, 1, 2, 3, 4 and 5. Therefore, it is impossible for the program to satisfy the users request.

The user re-enter his request. The program generates a list of random integers the user asked for:

wants to generate (b) the lower limit of the random integers (i.e.

C:Windows system32\cmd.exe How many random number do you want to generate? 10 ow small can these random integers be? How large can these random integers be? 7 12 14 9 11 8 7 10 16 6 Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!