Skip to content

Instantly share code, notes, and snippets.

View JarfigNewton's full-sized avatar

Jared Schilling JarfigNewton

View GitHub Profile

Hi Samantha,

It looks like you have a typo here.

pressence: true

should be

presence: true
@JarfigNewton
JarfigNewton / question2.md
Last active April 7, 2018 23:05
Question #2

Hi Raymond,

This is a tricky one to catch.

(params [:id])

needs to be

(params[:id])

Hi Gary,

You're very close here! But it looks like you're missing an end, so the code will return an error.

A neat feature about ruby is that it is whitespace insensitive. That means it can run the code with or without indentation. But this can get us into trouble sometimes! Indenting our code makes it more readable, and is generally considered best practice. In this case, I think it would've helped you notice you were missing that last end!

def is_even_and_divisible_by_5
  number = gets.chomp.to_i
 if (number % 2 == 0) && (number % 5 ==0)
@JarfigNewton
JarfigNewton / quiz3.rb
Created October 29, 2017 02:44
Quiz 3: OOP
class Mountain
attr_accessor :height, :base_diameter
def initialize(height, base_diameter)
@height = height
@base_diameter = base_diameter
end
def volume
(1.0/3) * (Math::PI * (0.5 * @base_diameter)**2) * @height