CSCI 446 Unit #3 Part I

Programming Assignment

For this part, you will write a very small JS program to explore objects + scope + first-class fn + hoisting. Because we want to use specific language statements, the grader will review your code, not just the program output.

Start with the following html shell:


<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF8">
</head>
<body>
<pre>
<script src="jsPlay.js"></script>
</pre>
</body>
</html>

NOTE: <pre> is needed so writeln statements will include the line break.

Your output will appear similar to the following (fn definition redacted), Note: include a "label" on each line, as shown in the figure, so the grader knows what each line represents.


ski area name: Monarch
isOpen call: false
isOpen 1st class fn: function() { XXX redacted XXX }
snowInches: 5
openSoon: true
openTomorrow: false
vertical undefined
vertical 800
avvy chance outside fn: 50
snowInches: 20
Figure 1: JSplay output

Take a look at the Specific Requirements to see what you need to include in your program. Your output should be very similar, except for ski area name and the function definition, which should not be redacted.