Let's stay fresh on Ruby methods. Here are a few challenges you can jump into to practice defining methods:
-
Define a currency converter from Dollars to Japanese Yen (The exchange rate is currently 1 Dollar = 105 Yen).
-
Define a method that is given a name and prints the phrase "Good Morning" with the name.
-
Define a method that, when called, prompts the user for their favorite song. Return the song name followed by the phrase, that is my favorite song too!!!
-
Ve have Vays to make you talk: Define a method that replaces all w's in a given string to v's.
-
Define a method that takes a string and replaces each letter in the string with the next letter in the alphabet. So "ABC" becomce "BCD" and "Cat" becomes "Dbu". (This is a tough one!)
View Stay Fresh: Methods on Learn.co and start learning to code for free.