Skip to content

Conversation

@kostik700015
Copy link

No description provided.

Copy link

@TurnerMooreDavis TurnerMooreDavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! one small issue with leap_year

@@ -0,0 +1,19 @@
def add_up(i)
if (i.class !=Integer) || (i <1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice validation!

puts sum
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is a bit off

@@ -0,0 +1,15 @@
def Ask(question)
puts question
string = gets.chomp + " "

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than adding a space to the end of the word here I would probably wait till the end of the method and just use join(' ')

full_name.push(Ask("Enter your middle name, please"))
full_name.push(Ask("Enter your last name please"))

puts "Hello " + full_name[0] + full_name[1] + full_name[2] + "!"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorta same as the above, I would use full_name.join(' ')

end
end

year = begin_year

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what this line is doing. begin_year is not defined at this point

@@ -0,0 +1,15 @@
words = []

while true do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to avoid using while true loops, because then if any of the branches within that loop do not break correctly you end up with an infinite loop, which is no good

word = gets.chomp
if word == ''
break
elsif word.index(/[^A-Za-z]/)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good validation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants