Advertisement
Guest User

Untitled

a guest
Oct 9th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. loop do
  2. puts "\n enter a string value or type exit"
  3. string = gets.chomp
  4. break if string == "exit"
  5. puts "\n enter a non negative integer or type exit"
  6. value = gets.chomp
  7. break if string == "exit"
  8.  
  9. puts "your response is: #{string[0, 3] * value.to_i}"
  10. end
  11.  
  12. puts "thank you for using this program – William Woodrum"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement