GithubHelp home page GithubHelp logo

ruby-boating-school-dumbo-web-82619's Introduction

mod1-code-review-boating-school

Welcome to Boating School, a Spongebob activity that simulates a system that tracks Boating Tests. We have three models - Student, Instructor, and BoatingTest.

Associations:

alt text

Student class:

  • should initialize with first_name
  • Student.all should return all of the student instances
  • Student#add_boating_test should initialize a new boating test with a Student (Object), a boating test name (String), a boating test status (String), and an Instructor (Object).
  • Student#all_instructors should return an array of instructors with whom this specific student took a boating test.
  • Student.find_student will take in a first name and output the student (Object) with that name
  • Student#grade_percentage should return the percentage of tests that the student has passed, a Float (so if a student has passed 3 / 9 tests that they've taken, this method should return the Float 33.33)

BoatingTest class:

  • should initialize with Student (Object), a boating test name (String), a boating test status (String), and an Instructor (Object)
  • BoatingTest.all returns an array of all boating tests

Instructor class:

  • initialize with a name
  • Instructor.all should return all instructors
  • Instructor#passed_students should return an array of students who passed a boating test with this specific instructor.
  • Instructor#pass_student should take in a student instance and test name. If there is a BoatingTest whose name and student match the values passed in, this method should update the status of that BoatingTest to 'passed'. If there is no matching test, this method should create a test with the student, that boat test name, and the status 'passed'. Either way, it should return the BoatingTest instance.
  • Instructor#fail_student should take in a student instance and test name. Like #pass_student, it should try to find a matching BoatingTest and update its status to 'failed'. If it cannot find an existing BoatingTest, it should create one with the name, the matching student, and the status 'failed'.
  • Instructor#all_students should return an array of students who took a boating test with this specific instructor.

Run ruby tools/console.rb in console to try out your code. You can add seed data to this file to have some sample objects to try out.

Here is some example seed data:

spongebob = Student.new("Spongebob")
patrick= Student.new("Patrick")

puff= Instructor.new("Ms.Puff")
krabs= Instructor.new("Mr.Krabs")

no_crashing = spongebob.add_boating_test("Don't Crash 101", "pending", puff)
power_steering_failure = patrick.add_boating_test("Power Steering 202", "failed", puff)
power_steering_pass = patrick.add_boating_test("Power Steering 201", "passed", krabs)'

ruby-boating-school-dumbo-web-82619's People

Contributors

mmacdonald1 avatar realandrewcohn avatar sylwiavargas avatar paulnicholsen27 avatar rrcobb avatar notnotdrew avatar maxwellbenton avatar morgvanny avatar

Watchers

Kevin McAlear avatar  avatar Mohawk Greene avatar Victoria Thevenot avatar Belinda Black avatar Bernard Mordan avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar Sophie DeBenedetto avatar  avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Nicole Kroese  avatar Kaeland Chatman avatar Lisa Jiang avatar Vicki Aubin avatar  avatar  avatar  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.