Git Product home page Git Product logo

upperline-hs-elective-arrays-lab-upperline-trevor-062016's Introduction

Elective Array

Pick a partner for this lab (or work in a group of three)

We're going to use test driven development (TDD) to write a set of methods that will help us organize and choose our electives for the school year. Go ahead and click Open in Nitrous to get started on this lab. The file where you will write your code is called elective.rb and the tests are in the spec directory in a file called elective_spec.rb.

As you work, remember to constantly run learn in terminal from the lab's main directory. It's how you'll test that you're getting the correct outcomes!

Here is the documentation on arrays if you need some help.

You're also going to need to use iteration for some of the answers. There are many different ruby methods that act out iteration, but we'll be using the each method for now.

Here is an example of how to use each:

candies = ["snickers", "milkyway", "reeses"]

candies.each do |candy|
  puts "I love #{candy} so much!"
end

The each method always requires the do and end keywords. The |candy| that you see is the declaration of a variable called candy that represents each individual item in the array. In this each code block we are iterating through the array and printing out how much we love each candy in the array.

View Elective Array on Learn.co and start learning to code for free.

upperline-hs-elective-arrays-lab-upperline-trevor-062016's People

Contributors

drabgrey95 avatar dfenjves avatar

Watchers

James Cloos avatar  avatar

Forkers

tamolinamendoza

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.