Thursday, January 3, 2008

IF...THEN...ELSE

The geek in me comes out:

COBOL
IF TEMP <= 35F
     THEN PERFORM 200-TRAINER-SESSION
ELSE PERFORM 300-RIDE-OUTSIDE

JAVA
import java.util.Training;
public class Train
{
      public static void main( String [] args )
      {
      Temperature temp = new Temperature( System.in );
      System.out.print( "Enter a temp > " );
      int temp = temp.nextInt( );

      if ( temp <= 35 )
           System.out.println( "Indoor Trainer Session" );
      System.out.println( "Ride Outside" );
      }
}

Perl
$outside_temp=32;

if ($outside_temp < 35)
      {
           print "Get on the trainer and pop in the Suffer-O-Rama DVD";
      }
print "Get outside and ride.";

1 comment:

Mateo said...

This is hilarious! From a fellow nerd who just spent two hours reading all your cross race reports.