1. Expand by clicking on the topic name
    Example: Objectives, Assignments and Due Dates, Required Readings, Required Tutorials, and so on or click on the Open All link located above the first blue area on the right of the screen.
  2. Scroll down to read Professor's Class Notes and Comments.
    These are essential to your success in the course.
Objectives

Chapter 2: Working with Functions, Data Types, and Operators
     After completing this chapter, the student will be able to:

  • Use functions to organize JavaScript Code
  • Use expressions and operators
  • Identify the operator precedence in an expression
Assignments and Due Dates
Assignments and Due Dates: View
Required Readings
Tutorials

None this week

Sample Code

Completed sample code from Chapter 02 JS6eTextCode_Chapter02
Download the zip file and extract it.

Supplemental Materials
  1. PowerPoint from Text: CS2513GosselinJS_CH02 - View (ppt) | Print (pdf)
Software

Same software as previously indicated.

Chapter Questions and Test Reviews

Chapter Review Questions
Source for quiz and test questions. It is highly recommended that students know the answers.

Chapter 2: Review Questions (.rtf file)
Test 1: Review Sheet

Required Assignments

CSP02 - Functions, Data Types, Operators: Specifications
     (Complete, upload to Apollo1, then submit URL in the LMS)
Weekly Quiz: Chapter 2 (Located in the LMS)

Professor's Class Notes and Comments

Chapter 2:

Although Chapter 2 covers a fair amount of material, the concepts should be ones with which you are familiar from Beginning Programming and/or other programming languages if you have used any. In many respects will be easier because it is a loosely typed language as compare to strongly typed (Java, VB, C++)

Study the Material: (Note: Although this outline may not be listed in future weeks, it is recommended that it be followed on an ongoing basis)

  1. Read the required text material including typing the sample code as appropriate.
    Note: Personally, sometimes I had trouble seeing the bigger picture while trying to piece the code together. For that reason, check out the Sample Code area above. It contains a zip file of the completed chapter project. I still recommend typing it in yourself, but hopefully this will help with your understanding.
  2. Use the supplemental materials as needed, answer the Chapter Review Questions, and check the text errata page. Depending on how you learn, it might be helpful to answer the Chapter Review Questions, and possibly annotating a page reference, as you initially read through the chapter. Whether you answer the questions as you read or after you read the chapter, just be sure to answer them. While the answers will not be submitted for a grade, quiz and test questions will come from these. (Links located above)
  3. Complete the Assignments (Assignment specifications and submission area within the LMS)
  4. Review the chapter using the Chapter review questions and the Test 1 Review Sheet.
  5. Take the weekly quiz (Located in the LMS)

CAVEAT:

Remember that function and variable names are case sensitive. Make sure the names match in both spelling and case.

P. 74

Want to know more about functions and more specifically anonymous functions? Check out http://www.w3schools.com/js/js_function_definition.asp (Scroll down to the anonymous function section). Give the hands-on excample a quick try.

P. 81

Be sure to full understand the addEventListener() technique. Older version of JavaScript did not use this but it adds a great deal of functionality. W3Schools also has a good explanation with some hands-on examples http://www.w3schools.com/jsref/met_element_addeventlistener.asp

P. 97

Be sure to read the note on the top of the page regarding binary and decimal values.

P. 101

When including quotes inside of quotes, it can be written either by alternating single and double quotes of by using escape characters

document.write ("<p>Sara Student 's favorite class is CS2513!</p>");
document.write ('<p>Sara Student\'s favorite class is CS2513!</p>');

P. 118

Note: W3Schools has a good demonstration of the difference between textContent and innerHTML
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_node_textcontent_innerhtml

When debugging code, remember = is an assignment operator x=1, and == is a comparison operator 1 == 1. Accidentally using the = instead of the == for comparison has resulted in much, much frustration for programmers debugging code.

Summary

Have you?

  • Read the entire weekly materials page
  • Read the professor's notes
  • Completed the required readings
  • Made the modifications to the Fan Trick Fine Art Photography website using the chapter instructions to modify the starter files (using the sample code download as needed).
  • Answered the Chapter 2 Review Questions
  • Used the supplemental materials you might have found helpful
  • Taken the chapter quiz
  • Completed the required assignments