programming-examples/perl/Statement/Analysis of sales results.pl

20 lines
442 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$metQuota = 0;
$didNotMeetQuota = 0;
$employeeCounter = 1;
while ( $employeeCounter <= 10 ) {
print "Enter quota result, (yes or no): ";
chomp( $result = <STDIN> );
$result eq 'yes' ? ++$metQuota : ++$didNotMeetQuota;
$employeeCounter++;
}
print "\nMet quota: $metQuota\n";
print "Failed to meet quota: $didNotMeetQuota\n";
if ( $metQuota > 8 ) {
print "Raise holiday bonuses!\n";
}