a1523xh15745123_bmi 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/bmi.rb +40 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4309f0f47a09abed602fa468cbd91cef70d5964b
4
+ data.tar.gz: c261ae03898f14e68562096d7cca0b986ea5881d
5
+ SHA512:
6
+ metadata.gz: 68a0374fed68eb53a622bd8901f2dfff2eac3007f13192b396054eb71b340265fda70622802217364ca39a99eeb72926d93f4f3ec4a398cdab036b72e6386c01
7
+ data.tar.gz: fd9cb1ca36c1af10e6870bce823b733f7fb07b8fa3a3c1421cf9dae077e3fcd0783772c8372c3d5ef98ec46f85d11f13dfd1ffdda4dd5dd9eb12c962f374a2c4
@@ -0,0 +1,40 @@
1
+ class Human
2
+ def initialize(height,weight)
3
+ @height = height
4
+ @weight = weight
5
+ end
6
+
7
+ def hello
8
+ puts "こんにちは。身長は #{@height}で、体重は #{@weight}です。"
9
+ end
10
+
11
+ def bmi
12
+ (@weight / (@height/100 * @height/100)).round(1)
13
+ end
14
+
15
+
16
+ def hello2
17
+ puts "BMI値は#{bmi}です。よろしくお願いします。"
18
+ end
19
+
20
+ # def check
21
+ # if @bmi < 18.5
22
+ # puts "細い"
23
+ # elsif 18.5 < @bmi < 24.99
24
+ # puts "正常"
25
+ # elsif 25 < @bmi < 32
26
+ # puts "肥満"
27
+ # else
28
+ # puts "too fat!!! you need "
29
+ # end
30
+ # end
31
+
32
+ end
33
+
34
+ me = Human.new(170.0,55.0)
35
+
36
+ me.hello
37
+ me.hello2
38
+
39
+ p me.bmi
40
+ #p human1.check
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: a1523xh15745123_bmi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - a1523xh黄暁吉
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-07 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple bin gem
14
+ email: a1523xh@aiit.ac.jp
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/bmi.rb
20
+ homepage: https://rubygems.org/profiles/akira007
21
+ licenses:
22
+ - AIIT
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.5
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Hola!
44
+ test_files: []