Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <!-- grades.html Alex Petlowany -->
- <!-- This web page calculates a students grades. -->
- <!-- ==================================================== -->
- <html>
- <head>
- <title> Grade Calculation </title>
- <script type="text/javascript">
- function AverageCalculation()
- // Assumes: that the boxes are only full of numbers
- // Results:
- </head>
- <body>
- <table style="border:solid">
- <tr> <td> quiz </td>
- <td> 20% </td> </tr>
- <tr> <td> test </td>
- <td> 60% </td> </tr>
- <tr> <td> homework </td>
- <td> 20% </td> </tr>
- <p> Input numbers to determine your grade.
- Quiz grade: <input type="text" id="Box1" size=3>
- Test grade: <input type="text" id="Box2" size=3>
- Homework: <input type="text" id="Box3" size=3>
- <input type="button" value="Calculate average"
- onclick="answer = parseFloat(Math.floor(document.getElementById('Box1').value * .20 +
- document.getElementById('Box2').value * .60 +
- document.getElementById('Box3').value * .20));
- document.getElementById('outputDiv').innerHTML =
- 'Your grade is ' + answer;">
- </p>
- <hr>
- <div id="outputDiv"></div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment