Skip to content

Instantly share code, notes, and snippets.

@ahimmelstoss
Last active December 23, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahimmelstoss/6709108 to your computer and use it in GitHub Desktop.
Save ahimmelstoss/6709108 to your computer and use it in GitHub Desktop.
a program that counts the letters in your name, given input. from chris pine's learn to program ch6.
puts "What is your first name?"
first_name = gets.chomp
puts "What is your middle name?"
middle_name = gets.chomp
puts "What is your last name?"
last_name = gets.chomp
puts "Did you know that here are " + (first_name.length + middle_name.length + last_name.length).to_s + " characters"
puts "in your name, " + first_name.capitalize + " " + middle_name.capitalize + " " + last_name.capitalize + "?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment