lamar211us
2007-02-20 07:04:28 UTC
#!/usr/local/bin/perl
@NumberArray = (0,0,0,0,0,0,0,0,0,0);
@EvenArray = (0,0,0,0,0,0,0,0,0,0);
@OddArray = (0,0,0,0,0,0,0,0,0,0);
$count1 = 1;
$count2 = 0;
$count3 = 0;
$EvenTotal = 0;
$OddTotal = 0;
print "Enter your first number: ";
chomp ($NumberArray[0] =
while ($count1 != 9)
{
print "Enter your next number: ";
chomp ($NumberArray[$count1] =
$count1 ++;
}
print "Enter your last number: ";
chomp ($NumberArray[$count1] =
while ($NumberArray[$count2] % 2 eq 0)
{
$EvenArray[$count2] = $NumberArray[$count2];
$EvenTotal = $EvenTotal + $EvenArray[$count2];
$count2 ++;
}
while ($NumberArray[$count3] % 2 eq 1)
{
$OddArray[$count3] = $NumberArray[$count3];
$OddTotal = $OddTotal * $OddArray[$count3];
$count3 ++;
}
#print "The numbers you entered were @NumberArray.\n";#
#print "@EvenArray\n";#
print "$EvenTotal\n";
print "$OddTotal\n";