Giter Club home page Giter Club logo

year-11-cs-unit-7-tutorial-song's Introduction

Year-11-CS-Unit-7-Tutorial-Song

Your job is to create a class called Song.

A new Song will take two parameters: title and artist. Both of these properties will be declared as private.

Song mountMoose = new Song("Mount Moose", "The Snazzy Moose");

A new Song will allow outside-class access to these two properties via two public getter methods.

mountMoose.getTitle() => "Mount Moose";

mountMoose.getArtist() => "The Snazzy Moose";

You will also have to create an instance method named howMany().

The method takes an array of people who have listened to the song that day. The output should be how many new listeners the song gained on that day out of all listeners. Names should be treated in a case-insensitive manner, i.e. "John" is the same as "john".

Example Song mountMoose = new Song("Mount Moose", "The Snazzy Moose");

// day 1 (or test 1) mountMoose.howMany(new ArrayList(Arrays.asList("John", "Fred", "BOb", "carl", "RyAn"))); => 5 // These are all new since they are the first listeners.

// day 2 mountMoose.howMany(new ArrayList(Arrays.asList("JoHn", "Luke", "AmAndA"))); => 2 // Luke and Amanda are new, john already listened to it the previous day Also if the same person listened to it more than once a day it should only count them once.

Example Song mountMoose = new Song("Mount Moose", "The Snazzy Moose");

// day 1 mountMoose.howMany(new ArrayList(Arrays.asList("John", "joHN", "carl"))); => 2

Good luck, have fun! :)

year-11-cs-unit-7-tutorial-song's People

Contributors

techarenz avatar nickfinbo 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.