programming-examples/perl/Statement/Average-sales problem with counter-controlled repetition.pl
2019-11-15 12:59:38 +01:00

12 lines
273 B
Raku

$total = 0;
$weekCounter = 1;
while ( $weekCounter <= 5 ) {
print "Enter sales for week $weekCounter: ";
chomp( $sales = <STDIN> );
$total += $sales;
++$weekCounter;
}