Hi Samantha,
It looks like you have a typo here.
pressence: true
should be
presence: true
Hi Samantha,
It looks like you have a typo here.
pressence: true
should be
presence: true
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)
| 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 |