Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#This program will take the name you input and spell it and as well as tell you how many letters are in your name.

puts "Please enter your name"
name = gets.chomp

def printChars(name)
  i = 0
  while i < name.length
    puts name[i]
    i += 1
  end
end

puts "This is how to spell your name:"
puts printChars(name);
puts "You have #{name.length} letters in your name."
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]