Coder Social home page Coder Social logo

katesliang / kwk-l1-intro-software-engineering-music-library-kwk-students-l1-dfw-070918 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-students/kwk-l1-intro-software-engineering-music-library-kwk-students-l1-dfw-070918

0.0 1.0 0.0 7 KB

License: Other

Ruby 100.00%

kwk-l1-intro-software-engineering-music-library-kwk-students-l1-dfw-070918's Introduction

Music Library

We all take how our music library works for granted. It just works, right? We can add artists and songs, we can make playlists, and we can delete songs. We just assume it will always work the same way every single time and we don't have to think about the rest.

But if we take a second to think about it, wouldn't a hash make sense? Every artist in your library would be a key, and the value would be their songs.

In this lab, we're going to build the inner workings of our very own music library program. In terminal, run learn to run the tests and check your work. Remember, the tests are written as guidelines for how your code should operate.

Step 1:

Define a method named list_artists. This method should use the each_key method to iterate over the hash and return all the artists (the keys). This method should accept a hash as an argument.

Step 2:

Define a method named list_songs. This method should use the each_value method to iterate over the music library hash and print out the name of the songs in the library. This method should accept a hash as an argument.

Step 3:

Define a method delete_artist. This method should delete the key-value pair from the hash based on the artist and return the updated hash. This method should take two arguments, the music library hash, and the artist. Remember, keys in hashes are symbols, so you'll need to expect the method to accept the artist as a symbol.

Step 4:

This method should add a new artist and song (key value pair) to the hash and return the updated hash. This method should accept three arguments, the library hash, the artist, and the song.

KWK-L1 Music Library

kwk-l1-intro-software-engineering-music-library-kwk-students-l1-dfw-070918's People

Contributors

aviflombaum avatar danielseehausen avatar dfenjves avatar katesliang avatar

Watchers

 avatar

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.