-
-
Save Luomint/82a3e6d6f6b41e5c39de to your computer and use it in GitHub Desktop.
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
#BMI weight in pounds / height in inches | |
puts "enter height" | |
height = gets.to_f | |
puts "enter weight" | |
weight = gets.to_f | |
bmi = (weight * 703)/(height ** 2) | |
puts "your bmi is #{bmi}" | |
## why does the code line order of height = gets.to_i and weight.get_to affect the answer | |
## i.e. if I put weight variable above height, my answer is inverted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment