Question: Define a function int [ ] GetRandom ( int N , int a , int b ) that returns an array of size N ,
Define a function int GetRandomint N int a int b that returns an array of size N of which all the
elements are random integers between a and b
B Points Define a function int Smallestint Y ref int pos that takes an integer array Y as input and returns
the smallest element in the array. It also uses passbyreference to find the index, pos, of the smallest element.
C Points Use the functions in A and B as part of a C# Console App program that analyzes a group of random
numbers. Here is how it works:
The user is prompted to enter positive integers: How many random numbers, lower bound and upper bound.
Upon receiving valid inputs, your program calls the function in A to get all the random numbers accordingly and
displays them. It then calls the function in B and finds the smallest element and its position.
If any of the user inputs is not valid, your program should display a warning message and allow reentering until a
valid value is entered.
The output of your program could look this:
How many random numbers are there, please?
What is the lower bound?
What is the upper bound?
The random numbers are:
Position# Number
The smallest among them is: at Position#
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
