Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write PHP that calculates the average value and the maximum value for any associative array $rating that follows the following format. You may assume $ratings
Write PHP that calculates the average value and the maximum value for any associative array $rating that follows the following format. You may assume $ratings values are always non-negative. The below array has 9 values, but future examples could have more keys/values.
$rating = array(
"TPM"=>4, "AOTC"=>2, "ROTS"=>4,
"ANH"=>4, "TESB"=>5, "ROTJ"=>4,
"TFA"=>2, "TLJ"=>3, "TROS"=>1);
#your php code here
echo $average; #prints 3.2222222222222
echo " ";
echo $maxval; #prints 5
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