Question: yes , this is a study question. I've been banging my head on a wall over this. what I have so far...

```
words = []
5.times do
  puts "Please enter a word:"
  words << gets.chomp.upcase
end

puts "Here are your words:" 
puts words.sort

```

start this video at 6:00
more info: <https://vimeo.com/125941774>

Answer: 
```
words = []
5.times do
  puts "Please enter a word:"
  words << gets.chomp   # no .upcase here, upcase converts all letters
end

result = words.sort.map.with_index do |w, i| 
           w[0] = w[0].upcase if i.odd?
         end
puts "Here are your words:" 
puts result

```
Capitalizing and Uppercasing Are Not Synonyms
---------------------------------------------

Capitalizing and uppercasing are two different things. Since your question asked about capitalizing (e.g. title-casing), you can construct your code around the following examples.

One example uses features from the latest MRI Ruby, while the other uses ActiveSupport from Rails. More complex solutions are possible by indexing into strings, but why do it the hard way?

### Ruby 2.3.0+

Use the new [String#capitalize](http://ruby-doc.org/core-2.3.0/String.html#method-i-capitalize) method. For example:

```
words = %w[foo bar baz quux wibble]
words.each_with_index.map { |word, idx| idx.even? ? word.capitalize : word }
#=> ["Foo", "bar", "Baz", "quux", "Wibble"]

```

This will capitalize ever other word in the list. Use [Integer#odd?](http://ruby-doc.org/core-2.3.0/Integer.html#method-i-odd-3F) instead of [Integer#even?](http://ruby-doc.org/core-2.3.0/Integer.html#method-i-even-3F) to check the *idx* variable if you prefer.

### Use Rails Extensions

If you have an older Ruby, you can use methods from [the facets gem](https://github.com/rubyworks/facets) or [the "inflections" string extension from Rails](http://guides.rubyonrails.org/active_support_core_extensions.html#inflections) to do the same thing. For example, with ActiveSupport:

```
require 'active_support/core_ext/string/inflections'

words = %w[foo bar baz quux wibble]
words.each_with_index.map { |word, idx| idx.even? ? word.titlecase : word }
#=> ["Foo", "bar", "Baz", "quux", "Wibble"]

```