#!/usr/local/bin/perl -w # A program for determine wheter user weighs too much, too little or has a normal weight. # Declare variables # $height # $weight print ("Hur lång är du?\n\n"); # asks users height. $height = ; # recieves the data. chomp ($height); # executes chomp if the last # character is a "\n". print ("Hur mycket väger du?\n\n"); # asks user weight. $weight = ; # recieves the data. chomp ($weight); # executes chomp if the last # character is a "\n". if ($height - 95 < $weight) { # compares height - 95 to weight. print ("Du är överviktig. Du borde börja banta.\n\n"); # prints some text. } elsif ($height - 105 > $weight) { # compares height - 105 to weight. print ("Du är ganska mager. Dragit ner på godiset, eller?\n\n"); # prints some text. } else { # if the can't be compared. print ("Du behöver inte oroa dig för din vikt, den är bra som den är.\n\n"); # prints some text. } print ("Program slut!\n"); # lets the user know that this # is the end of the program. exit; # ends program.