Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Perl: Write a subroutine, called above_average , which takes a list of numbers and returns the ones which are above the average (mean). (Hint:
Using Perl:
Write a subroutine, called above_average, which takes a list of numbers and returns the ones which are above the average (mean). (Hint: make another subroutine that calculates the average by dividing the total by the number of items.) Try your subroutine in this test program.
my @fred = above_average(1..10);
print "\@fred is @fred ";
print "(Should be 6 7 8 9 10) ";
my @barney = above_average(100, 1..10);
print "\@barney is @barney ";
print "(Should be just 100) ";
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started