linh 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/linh.rb +28 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 34635806b79b7d08feca693dc0a1a024eef9e973
|
4
|
+
data.tar.gz: bc9e7c80fa40e77253a0fad759bfcd849398144a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eea9216bf4db6b31e7ff47c7f3d705c2a6e06275314ecd447806a598687ba3149b579f5c2409369c559ffa27c0da3949f0b9b305f8201c1b1998694951020d3a
|
7
|
+
data.tar.gz: 9a5f5e6dd7b05dcca1b2fb3e4226ce37c13df50c7ef9ac49d7d9b417824a0ecf0d2355ff82e50f0e1cbcca32dc565344790ba52bfed425296ba9c3b13b65c8c2
|
data/lib/linh.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
class Linh
|
2
|
+
def self.bmi
|
3
|
+
puts "Height (cm): "
|
4
|
+
STDOUT.flush
|
5
|
+
h = gets.chomp.to_f
|
6
|
+
puts "Weight (kg): "
|
7
|
+
STDOUT.flush
|
8
|
+
w = gets.chomp.to_f
|
9
|
+
|
10
|
+
bmi = w/((h/100)**2)
|
11
|
+
puts "BMI = #{bmi}"
|
12
|
+
|
13
|
+
case bmi
|
14
|
+
when 0 .. 15
|
15
|
+
puts "Very severely underweight"
|
16
|
+
when 15 .. 16
|
17
|
+
puts "Severely underweight"
|
18
|
+
when 16 .. 18.5
|
19
|
+
puts "Underweight"
|
20
|
+
when 18.5 .. 25
|
21
|
+
puts "Normal"
|
22
|
+
when 25 .. 30
|
23
|
+
puts "Overweight"
|
24
|
+
else
|
25
|
+
puts "Obese Class"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: linh
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bao Linh
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-30 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: IBM calculating
|
14
|
+
email: a1447ll@aiit.ac.jp
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/linh.rb
|
20
|
+
homepage: http://rubygems.org/gems/linh
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.4.2
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: My 1st gem
|
44
|
+
test_files: []
|