A5: Math and Dates

On This Page


Overview

The main points of this assignment are to:

  • Use arithmetic in JavaScript
  • Work with the Math object
  • Work with the Date object

Specifications

In this lesson, you learned a great deal about the Date and Math objects. However, the best way to learn anything is through self exploration.

  1. Create a single Web page, any original page but name it index.html, and include in that page the following:
    1. At least 5 Date object method calls
    2. At least 5 Math object method calls
  2. If you use an external JavaScript file, you must name it index.js.
  3. Once you complete this page, test your JavaScript to ensure it works without error.

Other Specifications

  1. Complete a README.txt file following the instructions for homework.
  2. Zip your files and submit the zipped archive file to WebCT as explained in the section of this document: What to Turn In.

Extra Credit

The following are worth extra credit points:

  1. Complete the Review Assignment for Tutorial 2 that starts on page JVS 88 of the textbook. You must follow the steps exactly and turn in all the files to make it work in your assignment zip file. (2 points)
  2. Complete Case Problem 1 of Tutorial 2 that starts on page JVS 91 of your textbook. Include the extra credit solution files in your assignment zip file. (2 points)

Make certain that your README.txt file lists any extra credit attempted.

Hints for the Review Assignment

  • In the countdown() function, use some of the code from the NYClock() function:
    hours = (days - Math.floor(days)) * 24;
    minutes = (hours - Math.floor(hours)) * 60;
    seconds = (minutes - Math.floor(minutes)) * 60;
    
  • Figure 2-38 of the textbook has an error in the "Countdown to Event" value for July 4. It shows a time of 7:00 PM rather than the 9:00 PM time it should use. Ignore the two hour figure and use the 9:00 PM time.

Grading Criteria

The instructor will evaluate your assignment using the following criteria. Each criteria represents a specific achievement of your assignment and has a scoring guide. The scoring guide explains the possible scores you can receive.

Some scoring guides have a list of indicators. These indicators are a sign of meeting, or a symptom of not meeting, the specific criterion. Note that a single indicator may not always be reliable or appropriate in a given context. However, as a group, they show the condition of meeting the criterion.

For information on grading policies, including interpretation of scores, see the course information page.

Exploring the Math and Date Objects

  • 1 point for each Date object function call (5 possible).
  • 1 point for each Math object function call (5 possible).
  • -2 points if there are any JavaScript errors on the page
  • -1 point for using the wrong page name

REAME.txt File

  • 2: README.txt file submitted with specified information included
  • 1: README.txt submitted but some information was not included
  • 0: No README.txt submitted

Extra Credit Review Assignment and Case Problem

  • 2: Shows complete mastery of the problem.
  • 1: Shows some understanding of the problem.
  • 0: Not submitted, no substantial work, or has major problems

Maximum Score: 12, plus extra credit

What to Turn In

Submit your assignment following the instructions for homework. Create a single zip file with the following:

  1. README.txt file
  2. Your single web page, named index.html, with the Date and Math function calls
  3. Any other files needed to support your single html page
  4. If you completed the Review Assignment, then all the files needed for the Review Assignment to work properly
  5. If you chose to complete the extra credit, then all the files needed for the extra credit to work correctly.

You must submit all the files needed for your assignment to work properly. Do not assume that the instructors has any files. Your assignment must work as submitted.

Home | WebCT | Announcements | Schedule | Room Policies | Course Info
Help | FAQ's | HowTo's | Links

Last Updated: November 11 2006 @14:56:22