I'm trying to do a project for class and I am completely stumped. The project is this:
You are asked to build a page that will take in three grades, average them together and then return what letter grade that average is.
-You must provide a user interface that allows for the entering of 3 grades and the total number of points available for each grade. These should be done using HTML <input type = "text"/>.
-In your code you must add up the total points earned for all three grades and the total points possible, and determine the percent grade using Average = (total points earned / (total points available).
-Your code should be called by a button on the page.
-Your code should make use of If/Else statements to determine the letter grade.
-There should be a reset button to reset all text fields back to empty strings.
-Your results should output the following:
*Total points earned
*Total points possible
*Letter grade for that average
-Your page should make use of validation to ensure all fields are entered.
-Your code should also make use of a user defined function to return a letter grade for each of the three grades entered.
-No prompts should be used on the page, also no document.write or document.writeln
-All values should be input using textboxes
I get what I'm supposed to do but I have no clue how to actually write the code I need (I'm super new at this ). Here is the code I have.
<form name = "gradecalc"> <p>Grade 1: Earned Points <input type = "text"/> Out of:<input type = "text"/></p> <p>Grade 2: Earned Points <input type = "text"/> Out of:<input type = "text"/></p> <p>Grade 3: Earned Points <input type = "text"/> Out of:<input type = "text"/></p> <input name = "submit" onclick = "showsum(); type = "button" value = "Sum"/> <input name = "submit" onclick = "showavg(); type = "button" value = "Avg"/> <input name = "clear" type = "reset" value = "Clear Form"/> </form>