Name: ____________________________________________________ Alpha: _____________ Section: ________

Describe help received: _________________________________________________________________

See the bottom for how to submit your work.

Due: Before 0800 on next class day

  1. (10 pts) Read today's lecture notes. Honestly declare how you read the notes.
    1. (10 pts) I read the notes carefully. I have a good understanding of the topics therein.
    2. (10 pts) I read the notes carefully, but I don't really understand the following points well:
      
      
      
    3. (0 pts) I didn't read the notes carefully.
  2. [10pts] Assume that the usual selection_sort function has already been defined for arrays of integers. (You can assume that all numbers that we consider are greater than or equal to 0.) Define a before() function so that the numbers may be ordered as follows:
    1. The numbers should be ordered by their last digit in the descending order.
    2. The numbers with the same last digit should be ordered by their actual values in the ascending order.
    For example,
     

  3. [80pts] Write a program hw.cpp so that it reads 10 positive ints from the user and prints them in order as follows:

    An example run:

    ~/$ ./hw
    18 2 7 14 29 3 5 8 16 11
    3 5 7 11 29 2 8 14 16 18
    

Submit to the submission server (due: 0800 on the next class day)

~/bin/submit -c=IC210 -p=hw25 hw.cpp
Bring to class