This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.
Date objects
Block 2 is largely concerned with teaching students how to program using JavaScript. This section provides a number of questions to test your knowledge of the subject. The answers can be accessed by left clicking whenever you see this graphic at the end of a question (switch off pop-up blocker if you have one enabled)
The code I provide will often contain comments and appended notes as a means of explanation. I should also add that in some cases my code might not necessarily provide the only, or indeed the best solution to the question. However, the code will run under Netscape and this is something that you should practice on M150. JavaScript may run under MSIE, but it may fail under Netscape; I have certainly seen examples of this when marking end of course papers. For M150, you must ensure that your code correctly meets any requirements of a question by testing it on Netscape; this will be the browser that your tutor will use for testing TMA code.
Some of these questions are fairly demanding, particularly Q11, which to be honest is probably far more difficult than anything that you will face on M150.
Note:
<HTML>
<HEAD>
<TITLE>Test</TITLE>
<SCRIPT LANGUAGE = "JavaScript">
//On M150, JavaScript is placed
here in the head of the document
</SCRIPT>
</HEAD>
<BODY>
<!-- this is an HTML comment -->
<SCRIPT>
//However, JavaScript could be placed
here in the body of the doc
</SCRIPT>
</BODY>
</HTML>
<SCRIPT>
// or even here at the end
</SCRIPT>
For consistency, please follow the M150 "house-style" and embed your code in the head of the document. For these exercises, you are not required to write the HTML template.
Next page » Strings