IHYPRESS PROGRAMMING
CGI/Ruby programs with code and output for beginners
classic asp
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
Ruby (CGI Programming) ❯ If...Else
<16>
#!/usr/bin/ruby puts "Content-type: text/html\n\n" temp = rand (15..35) humid = rand (35..95) puts "<div style='color:blue; font-size:1.3em; font-family:sans-serif;'>" puts "Temperature is " + temp.to_s + "&deg;C and humidity is " + humid.to_s + "%<br>" if temp < 20 puts "It is cool outside. " elsif temp > 26 and humid > 50 puts "It is a muggy day. " else puts "It is a comfortable day. " end print "It is very humid! " if humid > 80 puts "</div>"
Hergestellt in Deutschland / Made in Germany
Temperature is 30°C and humidity is 63%
It is a muggy day.
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland