Guest User

Untitled

a guest
Jul 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.16 KB | None | 0 0
  1. <!doctype html>
  2. <!-- grades.html                                        Alex Petlowany -->
  3. <!-- This web page calculates a students grades. -->
  4. <!-- ==================================================== -->
  5.  
  6. <html>
  7.     <head>
  8.         <title> Grade Calculation </title>
  9.         <script type="text/javascript">
  10.                         function AverageCalculation()
  11.                         // Assumes: that the boxes are only full of numbers
  12.                         // Results:
  13.     </head>
  14.    
  15.     <body>
  16.     <table style="border:solid">
  17.         <tr> <td> quiz </td>
  18.              <td> 20% </td> </tr>
  19.         <tr> <td> test </td>
  20.              <td> 60% </td> </tr>
  21.         <tr> <td> homework </td>
  22.              <td> 20% </td> </tr>
  23.     <p> Input numbers to determine your grade.
  24.     Quiz grade: <input type="text" id="Box1" size=3>
  25.     Test grade: <input type="text" id="Box2" size=3>
  26.     Homework: <input type="text" id="Box3" size=3>
  27.     <input type="button" value="Calculate average"
  28.         onclick="answer = parseFloat(Math.floor(document.getElementById('Box1').value * .20 +
  29.                 document.getElementById('Box2').value * .60 +
  30.                 document.getElementById('Box3').value * .20));
  31.                 document.getElementById('outputDiv').innerHTML =
  32.                 'Your grade is ' + answer;">
  33.     </p>
  34.     <hr>
  35.     <div id="outputDiv"></div>
  36.     </body>
  37. </html>
Add Comment
Please, Sign In to add comment