Skip to content

Instantly share code, notes, and snippets.

@arthurschreiber
Forked from anonymous/gist:5324
Created August 13, 2008 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthurschreiber/5325 to your computer and use it in GitHub Desktop.
Save arthurschreiber/5325 to your computer and use it in GitHub Desktop.
puts "Hallo wie ist ihr Name?"
@name = gets.chomp
puts "WIr werden jetzt herausfinden ob sie\n-zu dick\n-zu dünn\n-oder genau richtig sind."
def hallo
puts "Geben sie bitte ihr Gewicht."
@gewicht = gets.chomp
puts "Geben sie bitte ihre Groese in >>METERN<< 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_i * 2)
if bestaetigung == "J"
puts "Gut. Ihr Bodymasindex betraegt #{@bmi}"
else
again = Objekt.new
again.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