Skip to content

Instantly share code, notes, and snippets.

@lyntco
Last active August 29, 2015 14:07
Show Gist options
  • Save lyntco/7bafd781e46d28504694 to your computer and use it in GitHub Desktop.
Save lyntco/7bafd781e46d28504694 to your computer and use it in GitHub Desktop.
Quiz-9 Say it in Engish

Say it in English

Write a program that will take a number from 0 to 99 and spell out that number in English.

In other words, if the input to the program is 22, then the output should be 'twenty-two'

e.g.

Say.new(22).in_english
Say.new(-1).in_english
# say.rb:7:in 'in_english': Number must be between 0 and 99, inclusive. (ArgumentError)

The program must also report any values that are out of range.

Some good test cases for this program are:

  • 0
  • 14
  • 50
  • 98
  • -1
  • 100

Extensions

Re-write the method for the Fixnum class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment