This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| continue = true | |
| count = 0 | |
| sum = 0 | |
| puts "Give me some input (words or numbers): " | |
| answer = gets.chomp | |
| words = "" | |
| #Concatenate words and exit once numbers are entered | |
| if (answer.to_i.to_s != answer) && (answer.to_f.to_s != answer) #evaluates words | |
| while continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| continue = true | |
| count = 0 | |
| sum = 0 | |
| while continue | |
| puts "Enter your number: " | |
| answer = gets.chomp | |
| if answer == "" | |
| puts "Goodbye!" | |
| continue = false |