Question: Please write a C# program For this part of the lab, you'll be writing methods to work with 1D arrays. We will expect you to
Please write a C# program
For this part of the lab, you'll be writing methods to work with 1D arrays. We will expect you to know how to create an array, and store and retrieve information from them.
- Continue working in the same project and Program.cs file.
- You will be generating random numbers, but the class Random is part of the standard library (dont need any additional using statements).
- You should consider developing the methods for this project incrementally.
- In Main, use an initializer list create an array of integers called nums holding the following values: 1, 4, 13, 43, -25, 17, 22, -37, 29.
- Write a method, called findLargest, that returns the largest value in the array and have the Main print the result.
- Create an integer array of size 20, called data and write a method to fill the array with random integers from [-100, 100].
- Recall that Randoms Next(x, y) method returns a value from x to y-1. The upper bound is exclusive, in other words. Modify the values to fit the required ranges.
- Use the findLargest method you previously wrote to return the largest value in data for the Main to print.
- Print the sum of the largest values from nums and data.
- Print the contents of data.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
