in reply to Please Help
After all the explaining above here is how you script should look like.
#!/usr/bin/perl use strict; use warnings; $| =1; print 'What is your name: '; my $reply = <>; chomp($reply); print $reply; print "\nHi $reply \n"; print "$reply, please enter your income tax:" ; my $var = <>; if ($var < 5000) { print "no tax"; } elsif ($var > 5000 && $var < 30000) { print "the tax rate is 10%"; } elsif ($var > 30000) { print "the tax rate is 20%"; } print "\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Please Help
by cpom1 (Initiate) on Sep 30, 2012 at 20:27 UTC |