Question
Using C# Write a console app that would generate special random numbers using command-line arguments as described below: The first two arguments serve as the
Using C# Write a console app that would generate special random numbers using command-line arguments as described below: The first two arguments serve as the lower and upper bounds for the list of random numbers to be generated. All remaining arguments (from the third and onward) indicate a list of integer numbers within the above range that to be excluded from the generated random numbers. The lower bound, upper bound as well as the list of excluded numbers will be passed to method GenerateSpecialRandom which will generate 50 valid random numbers and return them to the Main method using an out array parameter. Main() method will take the random numbers and output them separated with commas (,) on the console.
Hint: method GenerateSpecialRandom would need to have a variable number of arguments. (i.e., by using params int[] validNumbers ) Sample Run: // a list of random numbers between 5 to 15 but excluding 7,11,9, and 5 myApp.exe 5 15 7 11 9 5 Final generated random numbers are: 14, 12, 6, 10, 14, 8, 13, 10, 8, //No 5,7,9 or 11 are among them!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started