Results 1 to 2 of 2
  1. #1
    Megapixelz is offline Member
    Join Date
    Apr 2008
    Rep Power

    Default 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">

    Hopefully I did not confuse anyone... but I am confused myself. :o

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power

Similar Threads

  1. Functions in jsp
    By samson in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 03-25-2009, 11:04 PM
  2. Calculating trigonometric functions
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:56 PM
  3. Calculating hyperbolic functions
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:55 PM
  4. Replies: 4
    Last Post: 04-15-2008, 01:04 PM
  5. how to return values from hashmap
    By oregon in forum New To Java
    Replies: 2
    Last Post: 08-01-2007, 04:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts