RampUp Ruby

Week 3

In-class exercise - Calculating leap years

Determine if any given year is a leap year

Given a start and end year, return an array of all leap years between (and including) those years.

Lab 1 - Encrypt a string

Take a string and run it through an encrypt() method so it is no longer readable.

Run the encrypted string into a decrypt() string to bring it back to its original state.

BONUS POINTS: Make the case-sensitive test work

Lab 2 - Encrypt a string using a Caesar Cipher

http://en.wikipedia.org/wiki/Caesar_cipher

Take a string and run it through a caesar_encrypt() method so it is no longer readable. An offset number is required to set up your letter dictionary to meet the requirements of a Caesar cipher.

Run the encrypted string into a decrypt() string to bring it back to its original state. The offset number must be the same as the offset you passed to the encrypt method, otherwise the result will not be readable.

BONUS POINTS: Make the case-sensitive tests work

Running the test suites

This week you've got a test suite to show you if your solution is working! Stop coding when it passes!

To run the test suite, you'll need to make sure you have the rspec gem installed. In your terminal run: gem install rspec

Then for each lab, you can run your own code by typing:

ruby filename.rb

OR you can run the test suite by typing

rspec filename.rb

If you see all passing tests, you're done for the week!