Coder Social home page Coder Social logo

alt-code-challenge-2-web-082817's Introduction

Object Relations Assessment

Your Task

For this challenge, you have been given the job of creating a command line interface for your local drive-in movie theater, Happy's Sunset Drive-In! You have been asked to create a tracking tool that allows employees to know how many cars are at each movie screen. The drive-in has many screens, and each screen can have many cars. For the safety of all viewers, there is a limit to the number of cars that can be at a movie screen.

Notes

Your goal is to build out all of the methods listed in the deliverables and connect the required classes to a command line interface.

Do your best to follow Ruby best practices. For example, use higher-level array methods such as map, select, and find when appropriate in place of each

We've provided you with a tools/console.rb file, so you will be able to test out the methods that you write here.

To Submit - once you've completed all the deliverables, please copy/paste your three class definitions into the solution.rb file. Please don't submit the lab until we give you the signal.

Deliverables

Implement all of the methods described below:

DriveIn

  • DriveIn#screens
    • returns all movie screens
  • DriveIn#cars
    • this method should return all cars currently at all screens
  • DriveIn#full_house?
    • returns true if all movie screens are at capacity
  • DriveIn#whats_playing
    • returns the names of all movies currently playing

MovieScreen

#MovieScreen.new is provided for you in this lab, and takes in a movie title as a String and a capacity as an Integer

  • MovieScreen#cars
    • Returns an array of all cars currently at this movie screen
  • MovieScreen#at_capacity?
    • Returns a boolean. The return will be true if the number of cars at this movie screen is at capacity
  • MovieScreen#add_car
    • Adds an instance of a car to this movie screen if the movie screen is not at capacity, creates a new car instance and returns the string "Enjoy!". If the movie screen is at capacity, return a string that says 'Movie is sold out'
  • MovieScreen.all_screens
    • Returns all movie screens

Car

  • Car.all
    • Returns all cars
  • Car.movie_screen
    • Returns the movie screen this car is at

alt-code-challenge-2-web-082817's People

Contributors

maxwellbenton avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lmhufnagel

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.