Skip to content

Instantly share code, notes, and snippets.

Created August 13, 2008 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5324 to your computer and use it in GitHub Desktop.
Save anonymous/5324 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 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