Question
HP Form: I am trying to figure out how to drop lowest grade and average the other five grades. 1. If all six textboxes contain
HP Form: I am trying to figure out how to drop lowest grade and average the other five grades.
1. If all six textboxes contain values, load the values into an array and use the necessary functions of arrays to show the following separated by appropriate headings:
a)the top five quiz scores shown in descending order
b)the lowest quiz score that is dropped before the average is calculated
c)the average of the top five scores formatted to two decimal places
My Current code:
body> form action = "." method="post"> h3>Enter Quiz Scores:h3> label>Quiz 1: input name="score1" value="(!empty($scores[0])) echo $scores[0];?>" autofocus>%label>br> label>Quiz 2: input name="score2" value="(!empty($scores[1])) echo $scores[1];?>">%label>br> label>Quiz 3: input name="score3" value="(!empty($scores[2])) echo $scores[2];?>">%label>br> label>Quiz 4: input name="score4" value="(!empty($scores[3])) echo $scores[3];?>">%label>br> label>Quiz 5: input name="score5" value="(!empty($scores[4])) echo $scores[4];?>">%label>br> label>Quiz 6: input name="score6" value="(!empty($scores[5])) echo $scores[5];?>">%label>br> p>input type="submit" value="Find Average of 5 High Scores">p> form> if(count($scores)==6){ echo 'Graded Quizzes:
'; for ($arrayIndex=0; $arrayIndexecho ''
. number_format($Average,2).''; } else { echo 'Please enter scores in all textboxes.
'; } ?> body>
*************************************************************
Expected to work like this:
Enter Quiz Scores: Quiz 1: Quiz 2: Quiz 3: Quiz 4: 60% 50% 90% 78% 86% Quiz 5: Quiz 6: Find Average of 5 High Scores Graded Quizzes: 90 % 86 % 80 % 78 % 60 % Dropped Score: 50% Quiz Average: 78.80 % - Letter Grade: CStep 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