Giter Site home page Giter Site logo

school_challenge_2008's Introduction

School

Instructions

  • Fork this Repository
  • Clone your forked repo
  • Complete the activity Below
  • Push your solution to your repo
  • Submit a Pull Request from your repo to this repo
    • Put your name in your PR!

Iteration 1

For iteration 1, we have created all of the tests you will need - unskip tests one by one (by removing 'skip') and make each pass before moving on to the next test. The tests will model the following interaction pattern:

pry(main)> require './lib/school'
#=> true

pry(main)> school = School.new('9:00', 7)
#=> #<School:0x007fcaf4957830 @hours_in_school_day=7, @start_time="9:00", @student_names=[]>

pry(main)> school.start_time
#=> "9:00"

pry(main)> school.hours_in_school_day
#=> 7

pry(main)> school.student_names
#=> []

Iteration 2

For iteration 2, we have created all of the tests you will need - unskip tests one by one, making each pass before moving on the the next test. The tests will model the interaction pattern below. * The end_time method should add the hours_in_school_day to the start_time and return the time in 24 hour format. For example, 3:00 PM (12hour / clock time) is 15:00 (24hour). A school day will only ever start at the top of the hour (:00).

pry(main)> require './lib/school'
#=> true

pry(main)> school = School.new('9:00', 7)
#=> #<School:0x007fcaf4957830 @hours_in_school_day=7, @start_time="9:00", @student_names=[]>

pry(main)> school.add_student_name('Aurora')
pry(main)> school.add_student_name('tim')
pry(main)> school.add_student_name('megan')

pry(main)> school.student_names
#=> ["Aurora", "tim", "megan"]

pry(main)> school.end_time
#=> "16:00"

Iteration 3

Now, it is time for you to write your own tests! Follow the interaction pattern below to write one test, make that test pass, and move on to the next test. You will have at minimum, one test per new method. * A school is considered full time, if its has more than 4 hours in its school day. * The method standard_student_names will return a list of student names, capitalized ('megan' should become 'Megan').

pry(main)> require './lib/school'
#=> true

pry(main)> school = School.new('9:00', 7)
#=> #<School:0x007fcaf4957830 @hours_in_school_day=7, @start_time="9:00", @student_names=[]>

pry(main)> school.is_full_time?
#=> true

pry(main)> school.add_student_name('Aurora')
pry(main)> school.add_student_name('tim')
pry(main)> school.add_student_name('megan')

pry(main)> school.standard_student_names
#=> ["Aurora", "Tim", "Megan"]

Iteration 4

Continue writing tests to satisfy the following interaction pattern. * The method convert_end_time_to_clock_time will change the format of the end time to a 12 hour format (for example, 15:00 would be converted to 3:00).

pry(main)> require './lib/school'
#=> true

pry(main)> school = School.new('9:00', 7)
#=> #<School:0x007fcaf4957830 @hours_in_school_day=7, @start_time="9:00", @student_names=[]>

pry(main)> school.convert_end_time_to_clock_time
#=> "4:00"

school_challenge_2008's People

Contributors

mikedao avatar cpfergus1 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.