Develop a c console application that implements an int


Develop a C# console application that implements an int array. Use 2 'for' loops, the first to fill the array using the Random class to generate random integers using the next method of the Random class and a second for loop to iterate through the filled array and print the values entered into the array by the random number generator. Use the array's length variable to stay within the array bounds for both loops.

Possible output might look like this:
The array value is 488
The array value is 402
The array value is 237
The array value is 48
The array value is 390
The array value is 186
The array value is 425
The array value is 342
The array value is 477
The array value is 319

The first loop fills the array with random numbers; the second loop displays the elements put into the array once the loop is filled.

The steps are 1.  fill the array 2.  display the array elements

Adding in coding concepts to the above two statements we might arrive at the following pseudocode:

Begin Main

        create an array of ten (10) integers

        create/instantiate a random number object from the Random class

        for 0 to array length

               assign a random number using the random object to the integer array element

        end for

        for 0 to array length

               display each array element containing the assigned randomly generated number for that array

        end for

End Main

Solution Preview :

Prepared by a verified Expert
DOT NET Programming: Develop a c console application that implements an int
Reference No:- TGS01360025

Now Priced at $25 (50% Discount)

Recommended (93%)

Rated (4.5/5)