Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSara Brothers
7,341 PointsBoolean Ruby
I am not sure what they want in Task 1
car_speed = 50
speed_limit = 45
if (car_speed > speed_limit)
flash_car_speed(car_speed)
end
2 Answers
Francisco Ruiz
14,213 PointsHi Sara - The question doesn't seem to call it out, but it looks like they want you to have the else statement to call the display_car_speed method after the if you currently have i.e. Also, I don't think you need to call any parameters in the flash_car_speed method, so just writ it without paranthesis
if(car_speed > speed_limit)
flash_car_speed
else
display_car_speed
end
Hope that helps :)
Nick Perri
7,636 PointsYou actually don't need to include the car speed when you call flash_car_speed.
In that problem they assume the method flash_car_speed does not take a speed as argument.
Your if statement just needs to contain the method name:
flash_car_speed
in it.