Can anyone spot a light where am I going wrong?
This is the objective of the program:
To make a program that has a function that is passed 3 quiz scores and returns the average of the top 2 scores.
<?php
function average ($quiz1, $quiz2, $quiz3) {
$quiz1 = 100;
$quiz2 = 50;
$quiz3 = 80;
$average1 = $quiz1 + $quiz3 / 2;
$average2 = $quiz2 + $quiz3 / 2;
$average3 = $quiz3 + $quiz1 / 2;
echo $average1;
echo $average2;
echo $average3;
return ($average);
}
echo max ($average1, $average2, $average3);
average (100, 50, 80);
?>
$averagefrom your function, but don't have an actual variable called$averagein the function to return.