Created
July 21, 2016 06:17
-
-
Save adriculous/b55d7f279d6d191f31a0518ffbd946eb to your computer and use it in GitHub Desktop.
PEMDAS!!!
This file contains 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
# You are now at the Always 3 script. It's in Ruby, girl. Hello and welcome! | |
# Ask the person (user) to provide a number. Any number. | |
puts "Please, give me your number, I mean A number!" | |
# Hint: use 'gets' method, convert to an integer using 'to_i', make it a variable | |
i_number = gets.to_i | |
# Hmm... PEMDAS? ("Please Excuse My Dear Aunt Sally") | |
puts "You know what it is! " + (((i_number + 5) * 2 - 4) / 2 - i_number).to_s + " of course!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment