Save 36% for Black Friday! Learn more



50 Experience
0 Lessons Completed
0 Questions Solved


Posted in Help

Implement a Ruby method can_you_vote? that returns true or false depending on the given age.

This method should take one arguments (age), an Integer, and return a Boolean(true/false).
can_you_vote?(18) & can_you_vote?(30) should return true
can_you_vote?(16) should return false.

This is a question i was provided however i am constsantly getting syntax errors, i am in my first week of Ruby and have really hit a dead end.

my sytax error filled answer so far is:

def can_you_vote?(age)

if age > 17
print "True"
if (age) < 18
print "False"


Any direction on where i am going wrong would be greatly appreciated

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.