Writing Homework Help

Use Of Arrays and Methods Discussion

 

Using arrays, we’re now able to process larger collections of data instead of working with separate individual variables.

In your opinion, what is the biggest benefit of using an array instead of individual variables and why?

At this point, we’ve only seen how to use arrays with simple data types like integers. Once we introduce creating our own data types with classes, you’ll be able to create an array of objects that stores multiple bits of information about each item.  For example, if you’re creating an application that lists gas prices by city, you can have a data type that stores the price, location, and name at each gas station.  With this in mind, give an example of a data type you could create and store in an array for processing (in our gas price example, we could print out a list of prices and search to show the cheapest gas).

  1. We covered some methods in the System.Array class this chapter.  Ever wonder what that code looks like?
  2. Browse the following link to see the reference source for it’s implementation: https://referencesource.microsoft.com/#mscorlib/system/array.cs
  3. Look for the BinarySearch, Sort, and Reverse methods

Don’t be overwhelmed by everything going on in that class, but what is your initial impression and are you able to learn or find anything interesting by viewing that code?