paula / array-iteration-mini-lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I'm So Busy

farmer_tasks = ["Milk the cow", "Churn the butter", "Drive the tractor", "Peel potatoes", "Plant the corn"]

Use .each to print out the string "I'm so busy! I need to #{task}" for each of the tasks in the farmer_tasks array.

Add Ten and Divide By Two

some_numbers =[2, 52, 19, 46, 1000]

Use .each to add ten to each number and then divide it by two and puts this new number to the screen.

Reverse Presidents

presidents = ["George Washington", "John Adams", "Thomas Jefferson", "James Madison", "James Monroe", "John Quincy Adams"]

Use .each to print out a string with the name reversed for each of the presidents in the presidents array.

10 Bottles of Milk on the Wall

Create an array with the numbers 10 down to 0. Using .each, for every number puts the string "___ bottles of milk on the wall", filling in the blank with the number in your array.

About

License:Other


Languages

Language:Ruby 100.0%