View Single Post
  #1 (permalink)  
Old 04-30-2008, 04:55 AM
Megapixelz Megapixelz is offline
Member
 
Join Date: Apr 2008
Posts: 1
Megapixelz is on a distinguished road
Using functions that return values?
Hi, I am supposed to write a program that returns quality points based on a grade. I have been given the table that includes the form, however the form needs to have a function and it calls the function from a separete javascript file. The program is supposed to return a number between 1 and 4 dependong on the grade. If the grade is between 90-100 the the number would be 4. If the grade were between 80-89 the the returned number would be 3. Between 70-79 = 2 and between 60-69 = 1.
Here is the skeleton i wrote based on what I've tried to learn about this. This skeleton is inside the separate file.

<script type="text/javascript">
function qualityPoints (average)

{


return ;

}
<script type="text/javascript">
document.write(qualityPoints())
</script>

Hopefully I did not confuse anyone... but I am confused myself.
Reply With Quote
Sponsored Links