Created
August 13, 2008 22:39
-
-
Save anonymous/5324 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
puts "Hallo wie ist ihr Name?" | |
@name = gets.chomp | |
puts "WIr werden jetzt herausfinden ob sie\n-zu dick\n-zu duenn\n-oder genau richtig sind." | |
def hallo | |
puts "Geben sie bitte ihr Gewicht." | |
@gewicht = gets.chomp | |
puts "Geben sie bitte ihre Groese in >>METERN<<(z.B 1.65 ein." | |
@groese = gets.chomp | |
puts "#{@name}, sie sind #{@groese} Groß und wiegen #{@gewicht}.\n Ist das richtig?\n" | |
puts "Bitte geben sie J oder N ein." | |
bestaetigung = gets.chomp | |
@bmi = @gewicht.to_i / (@groese.to_f ** 2) | |
if bestaetigung == "J" | |
puts "Gut. Ihr Bodymasindex betraegt #{@bmi}" | |
else | |
puts "Dan nochmal" | |
hallo() | |
end | |
if @bmi < 19 | |
puts "o.0 Schnell zu Mc Donalds^^" | |
elsif @bmi < 25 | |
puts "PERFEKT" | |
elsif @bmi < 30 | |
puts "SCHNELL INS FITNESSTUDIO" | |
end | |
end | |
hallo() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment