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 ask(question) | |
# Defines method for asking questions and receiving input. | |
puts question | |
gets.chomp! | |
end | |
def get_name | |
puts "What is your full name?" | |
full_name = gets.chomp! | |
end |
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 |
NewerOlder