Homework Assignment #2

NAME: _________________________________________________________

DATE:  ______________

Assignment:  Items worth 2 points unless otherwise specified

  1. ___ Print out this page, delete the ad at the top of the page, and put your name and the date on top on top.
  2. ___ Create a class to store a number, and retrieve a number.
  3. ___ Create a class for using a bubble sort algorithm.
  4. ___ Create an array (50 in length) which will store the class from item #2.
  5. ___ Fill the array with random numbers, placed into the appropriate class.
  6. ___ Display the unsorted array.
  7. ___ Sort the array.
  8. ___ Display a message when the end of a loop is reached.
  9. ___ Display a message when a swap is made.
  10. ___ Display the sorted array.
  11. ___ Request form the user, whether they would like to run through the sort again.

Extra Credit:

____ Make the necessary changes to calculate and display how often a number was swapped. (6 points)

-- Good Luck.