Skip to content

Conversation

@Dan88Hus
Copy link

@Dan88Hus Dan88Hus commented Nov 1, 2021

No description provided.

@@ -0,0 +1,28 @@
# (1) Write a program which asks for a person's first name, then middle, then last. It should store each of these parts in an array. Finally, it should greet the person using their full name. Call the program full_name.rb.

Choose a reason for hiding this comment

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

Good use of a Ruby hash for storing data.

array.each do |i|
if i % 400 == 0
puts i.to_s + ' is leap year'
elsif i % 4==0 && i % 100 != 0

Choose a reason for hiding this comment

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

Watch for the indentation here, make sure all lines are aligned in the block.

break if not swapped
end

array

Choose a reason for hiding this comment

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

Nice old-fashion way of sorting array elements.

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