Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a script that allows a user to enter a numeric grade and then determine th

ID: 3825545 • Letter: W

Question

Write a script that allows a user to enter a numeric grade and then determine the letter grade. Use a PHP document and a HTML document containing a form with 5 text boxes to enter the numeric grades. Print a message to the user stating whether or not the grade is valid (remember the numeric grade can only be between 0 – 100), and the letter grade for each numeric grade entered. Use the grade determination criteria from the syllabus. Example if a grade between 90 – 93 is entered, a letter of A- will display to the screen. If only 4 grades were entered, then only 4 letter grades should be listed to the screen. Save the documents as grades.html and grades.php.

Explanation / Answer

#!/usr/bin/env bash
read -erp 'Enter numeric grade (q to quit): '
case $REPLY in [qQ]) exit;; esac
declare -A cutoffs
cutoffs[F]=59 cutoffs[D]=69 cutoffs[C]=79 cutoffs[B]=89 cutoffs[A]=100
or letter in F D C B A; do
((REPLY <= cutoffs[$letter])) && { echo $letter; exit; }
done
echo "Grade out of range."

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote