Skip to content

Instantly share code, notes, and snippets.

@ajrussellaudio
Created December 2, 2016 09:39
Show Gist options
  • Save ajrussellaudio/6b19348c5dc6dd52204f2bb5f7bb21ba to your computer and use it in GitHub Desktop.
Save ajrussellaudio/6b19348c5dc6dd52204f2bb5f7bb21ba to your computer and use it in GitHub Desktop.

JS Record Store

Learning Objectives

  • Implement an OO JS program using the 'new' keyword
  • Practice adding methods to objects
  • Using JS data structures and loops
  • Practice building a TDD program from scratch

Requirements

  • Use TDD all the way through!
  • Create a constructor to create Record objects with artist, title, price
  • Create some new records
  • Create a RecordStore that has a name, city and multiple records in it's inventory
  • Give the RecordStore a balance i.e. cash in bank.
  • Add some records to your RecordStore.
  • Create a method that lists the inventory.

Extensions

  • Create a method so that the RecordStore can sell a record. Adjust the cash in bank to take into account the price of the record sold.
  • Create a method that reports on the financial situation of the store. Cash and value of inventory.
  • Create a RecordCollector (or customer) constructor who can buy and sell records.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment