Exchange Sort (2)

  1. Extend your previous program about Exchange Sort so that it will input the name, height, and weight of 8 players. For example,
    
    LeBron-James 203 109
    Bolt 196 94
    D-Bryant 188 100
    C-Johnson 197 107
    Ibaka 208 111
    A-Peterson 185 98
    J-Jones 193 93
    Phelps 192 88
    
    
  2. Sort them by height. Print the result.
  3. Then sort them by weight, and print the result.
  4. Finally, print the original input so that you can compare the results.
  5. When you print out player names, please right-justify them.

The output may look as follows.

===============
Sort by height:
===============
       Ibaka    208     111
LeBron-James    203     109
   C-Johnson    197     107
        Bolt    196     94
     J-Jones    193     93
      Phelps    192     88
    D-Bryant    188     100
  A-Peterson    185     98
===============
Sort by weight:
===============
       Ibaka    208     111
LeBron-James    203     109
   C-Johnson    197     107
    D-Bryant    188     100
  A-Peterson    185     98
        Bolt    196     94
     J-Jones    193     93
      Phelps    192     88
=====================
Original input order:
=====================
LeBron-James    203     109
        Bolt    196     94
    D-Bryant    188     100
   C-Johnson    197     107
       Ibaka    208     111
  A-Peterson    185     98
     J-Jones    193     93
      Phelps    192     88