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.
Requirments-
-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
*Percent average
*Letter grade for that average
-Your page should make use of validation to ensure all fields are entered.
BONUS
-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
<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>
I have no idea how to build a function that can do the averaging. I don't think I need the Sum button but other code I have looked at used it and it worked but I'm not sure where to go from here. Also does anyone have any good websites or something to help learn javascript? I have Lynda.com for my classes but it does'nt teach me what syntax I should be using for something like this.

New Topic/Question
Reply


MultiQuote





|