Guest User

Untitled

a guest
Apr 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. # ----------------------------------------------------------------- /
  2. # Exercise 3.1
  3. # ----------------------------------------------------------------- /
  4.  
  5. # prompt user for name
  6. def prompt
  7. puts "Please enter your name:"
  8. gets.chomp
  9. end
  10.  
  11. # print "Hello " concatenated with argument...
  12. def greet(name)
  13. p "Hello " + name
  14. end
  15.  
  16. # make call to greet using return value from prompt
  17. greet(prompt)
Add Comment
Please, Sign In to add comment