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
| def getNumbers(workingArray) | |
| # Method to take multiple integers as input from user. | |
| puts "Please enter the numbers you'd like me to use. Type 'done' when you're finished." | |
| nextnum = 0 | |
| # Creates nextnum as variable. | |
| while nextnum != "done" | |
| nextnum = gets.chomp! | |
| if nextnum == "done" | |
| puts "Calculating!" | |
| elsif nextnum != "0" && nextnum.to_i == 0 |