Module: A1420ksBmi
- Defined in:
- lib/a1420ks_bmi.rb,
lib/a1420ks_bmi/version.rb
Constant Summary collapse
- VERSION =
"0.1.1"
Class Method Summary collapse
Class Method Details
.getbmi ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/a1420ks_bmi.rb', line 4 def self.getbmi print "Enter your Height ==>" height = gets.to_i print "\n" print "Enter your Weight ==>" weight = gets.to_i height = height ** 2 bmi = weight / height.to_f bmi = bmi * 100 print "\n" printf("Your BMI index is %.3f",bmi.to_f) end |