GAD225 HW 2

  1. Create an Array with 100 numbers in it. Each number should be randomly generated, and somewhere between 1 and 100.
  2. Tell me the total of all the numbers in the array.
  3. Tell me the average of all the numbers in the array.
  4. Tell me the value of the biggest number in the array.
  5. Tell me the value of the smallest number in the array.
  6. Sort the array (by hand, DO NOT USE the built in sort() function). We will discuss a method for doing this in class.
  7. Tell me the median value of the numbers in the array.
  8. Tell me the mode of the array.

Function Stuff:

  1. Each of the numbers above should be their own function, taking in the array as a parameter, and returning whatever is appropriate.
  2. Call each function based on user input (create a menu system, similar to InputCruncher).
  3. This may require some global data, but still pass stuff around via parameters where you can.
Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Fark
  • Google Buzz

One Response to “GAD225 HW 2”

  1. Joel Natkin Says:

    Where do I enter the number within InputCruncher?
    Thanks!