#!/usr/local/bin/perl -w $input = ''; #temporary input $hrate = 0; #pay rate $yrate = 0; #yearly salary while () { print 'Do you wish to calculate yearly salary (y) or hourly rate?( +h)'; chomp ($input = <STDIN>); if ($input eq '') { last; } if ($input =~ /h/) { print "Enter your hourly rate:"; chomp ($hrate = <STDIN>); $yrate = ($hrate * 40) *52; } }print "Your yearly salary is $yrate";
In reply to New to Programming and I have chose PERL by snowsurfer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |