Cis 120 Bundle Of Office 2013 Text With Required Online Homework Sam 2013

Online Course Information


Online course information is provided as a resource to help students make informed decisions about the time commitment and other requirements necessary for success in online courses. The information here provides students with time requirements and specific skills necessary to be successful in a wide selection of online courses and will assist students in determining their ability to be successful in a specific online course, prior to registering for a specific course. The information provided is general and provided as a resource only. Each course’s specific syllabus is the defining source for all course information and policies.

This information applies to online (IN) sections only. Traditional (TR) and Hybrid (HY) courses will have attendance and other requirements. Check back often as more courses will be added over time. Questions or comments please email: wcc-de@waynecc.edu

ACC 120- Principles of Financial Accounting
ACC 121- Principles of Managerial Accounting
ACC 122 – Principles of Financial Accounting II
ACC 129 – Individual Income Taxes
ACC 130- Business Income Taxes
ACC 220- Intermediate Accounting II

ANS 110- Animal Science
ANS 210- Livestock Production Issues

BIO 110- Principles of Biology

BUS 110- Introduction to Business
BUS 115- Business Law I
BUS 116- Business Law II
BUS 137- Principles of Management
BUS 153- Human Resource Management
BUS 225- Business Finance
BUS 239- Business Applications Seminar
BUS 240- Business Ethics

CIS 110- Introduction to Computers

ENG 111- Writing and Inquiry
ENG 112- Writing/Research in the Disciplines

HIS 131- American History I
HIS 132- American History II

HUM 110- Technology and Society

MAT 143- Quantitative Literacy
MAT 171- Precalculus Algebra

MKT 120 Principles of Marketing

Other WCC Online Learning Resources (these links open in a new window)

Distance Education and Webadvisor Help Desk

Online Learner Survival Guide

Moodle Demo Course 

ACC 120

Principles of Financial Accounting

Required Textbooks: Corporate Financial Accounting, 13th edition by Warren, Reeve, and Duchac published by South-Western Cengage Learning plus Cengage NOW with e-book and a one-semester Printed Access Card (PAC) ISBN: 9781305617025

Average number of hours required to be successful in this course:

16-week course: Minimum 15 hours per week

8-week course: n/a

Additional software or supplies: If students purchase the book at the WCC bookstore it comes with the CNOW code. At a minimum, a student must have access to CNOW for this book.

In this course students can expect to complete or participate in the following activities:  Each chapter will have Tell Me More Problems, Homework, and a test. The course covers nine chapters. There is also a comprehensive problem.

Define academic progression in this course: Accounting majors and College Transfer students must maintain a C average to be successful in this course. Business Administration students can pass with a D average. Students will be dropped from the course if they miss more than one chapter’s worth of assigned work.

Policy on make-up exams and/or late assignments: No late work and no make-ups on missed work allowed.

Prerequisites- and Co-requisites: DMA 010-030 and DRE 098

Required On-Campus Visits: None

Additional information: The Accounting Lab, located in Spruce 133, is staffed by student tutors available to assist students  with understanding the material. Achieving a thorough understanding of the first four chapters is imperative to student success as each chapter builds on the previous chapter.

ACC 121

Principles of Managerial Accounting

Required Textbooks: Managerial Accounting,CengageNOWv2 1-Semester Card, Warren/Reeve/Duchac, 9781305617049

Average number of hours required to be successful in this course:

For 16-week session: minimum 15 hours per week
For 8-week session:
n/a

Additional software or supplies: When purchased at the WCC bookstore the code comes bundled with the book. At a minimum, students must have access to CNOW

In this course students can expect to complete or participate in the following activities: Each chapter will have Tell Me More Problems, Homework, and a Test. There are a total of 10 chapters covered. There is also a comprehensive problem and a final exam.

Define academic progression in this course: Accounting majors and College Transfer students must maintain a C average to be successful in this course. Business Administration students can be successful with a D average.

Policy on make-up exams and/or late assignments: No late work and no make-up work is allowed.

Prerequisites- and Co-requisites: ACC 120 – Principles of Financial Accounting is a pre-requisite

Required On-Campus Visits: No required on-campus visits.

Additional information: The  Accounting Lab, located in Spruce 133, is staffed by student tutors available to assist students  with understanding the material.

ACC 122

Principles of Financial Accounting II

Required Textbooks: Bundle: Financial and Managerial Accounting (volume 1) plus a 2-semester CNOW access code; 12th edition; by Warren, Reeve and Duchac; published by South-Western Cengage Learning; ISBN: 9781285715131

Average number of hours required to be successful in this course:
For 16-week session: 9 to 12 hours a week
For 8-week session: n/a

Additional software or supplies: If you do not purchase the bundle from the WCC Bookstore, you will need to purchase the CNOW access code separately.

In this course students can expect to complete or participate in the following activities: Exercises, problems, a continuing problem, a comprehensive problem and chapter tests

Define academic progression in this course: If a student misses two chapter tests, he/she will be dropped from this course. If a student does not take the final exam or submit the Signature Assignment, when scheduled, the student will receive a grade of “F” for the course.

Policy on make-up exams and/or late assignments: No late assignments are accepted but you will be allowed to make-up a missed test

Prerequisites- and Co-requisites: Prerequisites: ACC 120 Co-requisites: None

Required On-Campus Visits: No required on-campus visits

Additional information: There is a Business and Accounting Lab for students that need some additional assistance. The lab hours are listed on the syllabus.

ACC 129

Individual Income Taxes

Required Textbooks: Bundle: Income Tax Fundamentals 2015 (with H&R Block Tax Preparation Software CD); 33rd edition; by G.E. Whittenburg, M.Altus-Buller, and S. Gill; published by South-Western Cengage Learning plus Cengage NOW with e-book and a one-semester Printed Access Code (PAC); ISBN: 9781305600010

Average number of hours required to be successful in this course:

For 16-week session: 12-15 hours/week

For 8-week session: n/a

Additional software or supplies:  If you do not purchase the bundle from the WCC Bookstore, you will need to purchase the CNOW code separately.

In this course students can expect to complete or participate in the following activities: Questions, Problems, Tax Returns, Chapter Tests and a Signature Writing Assignment

Define academic progression in this course: No late assignments are accepted but you are allowed to make-up a missed test

Policy on make-up exams and/or late assignments: If a student misses two chapter tests, he/she will be dropped from this course. If a student does not take the final exam or submit the Signature Assignment, when scheduled, the student will receive a grade of “F” for the course.

Prerequisites- and Co-requisites: None

Required On-Campus Visits: None

Additional information: There is an Open Business and Accounting Lab for students who need additional assistance. The hours will be posted after the semester begins.

ACC 130

Business Income Taxes

Required Textbooks: Bundle: Income Tax Fundamentals 2015 (with H&R Block Tax Preparation Software CD); 33rd edition; by G.E. Whittenburg, M. Altus-Buller, and S. Gill; published by South-Western Cengage Learning plus Cengage NOW with e-book and a one-semester Printed Access Card (PAC); ISBN: 9781305600010

Average number of hours required to be successful in this course:
For 16-week session: 12 to 15 hours per week
For 8-week session:

Additional software or supplies: If a student does not purchase the bundle from the WCC Bookstore, they will need to purchase the CNOW code separately

In this course students can expect to complete or participate in the following activities: Questions, problems, tax returns, and chapter tests

Define academic progression in this course: Once a student has missed two chapter tests, he/she will be dropped from this course. Students failing to complete the final exam when scheduled, will receive a grade of “F” for this course.

Policy on make-up exams and/or late assignments: No late assignments will be accepted.

Prerequisites- and Co-requisites: Prerequisites: ACC 220 Co-requisites: None

Required On-Campus Visits: None

Additional information: The textbook that is used in this class is the same textbook that was used in ACC 220. Students who took this course in the fall should not need to purchase another textbook. There is an Open Business and Accounting Lab for students who need additional assistance. The hours will be posted after the semester begins.

ACC 220

Intermediate Accounting II

Required Textbooks: Bundle: Intermediate Accounting: Reporting and Analysis; second edition; by Wahlen, Jones and Pagach; published by South-Western Cengage Learning plus Cengage NOW with e-book and a two-semester Printed Access Card (PAC); ISBN: 9781305715417

Average number of hours required to be successful in this course:
For 16-week session: 15-20 hours/week
For 8-week session:

Additional software or supplies: If  a student does not purchase the bundle from the WCC Bookstore, the student will need to purchase a CNOW code separately..

In this course students can expect to complete or participate in the following activities: Questions, Exercises, Problems and Chapter Tests

Define academic progression in this course: If a student misses three chapter tests, the student will be dropped from this course. If a student does not complete the final exam when scheduled, the student will receive a grade of “F” for this course.
Policy on make-up exams and/or late assignments: No late work is accepted.  Students will be allowed to make-up two missed chapter tests.

Prerequisites- and Co-requisites: Prerequisites ACC 121 and a “C” or better in both ACC 120 and ACC 121

Required On-Campus Visits: none

Additional information:  There is an Open Business and Accounting Lab for students who need additional assistance. The hours will be posted after the semester begins.


ANS 110

Animal Science

Required Textbooks: Introduction to Animal Science: Global, Biological, Social and Industry Perspectives, W. Stephen Damron, 978-0-13-262389-6

Average number of hours required to be successful in this course:
For 16-week session: 5-6 hours each week.
For 8-week session:
Additional software or supplies: All work is completed in Moodle;  however,  agednet.com is used as a resource

In this course students can expect to complete or participate in the following activities: Discussion Forums, Assignments, Research papers, Quizzes.

Define academic progression in this course: Weekly assignments open on Monday morning at midnight. Students have until Sunday night at 11:59 to complete all assignments for the week. If a student goes 15 days without completing an assignment, they are dropped from the course.

Policy on make-up exams and/or late assignments: Work must be completed by midnight on Sunday nights for the previous week. Late assignments are deducted 10 points each day they are late with a 0 being given at the end of the 10 day period. Tests and quizzes are turned off at midnight on Sunday nights and not given late or as make up quizzes except under extenuating circumstances.

Prerequisites- and Co-requisites: none

Required On-Campus Visits: none

Additional information: none

ANS 210

Livestock Production Issues

Required Textbooks: Contemporary Issues in Animal Agriculture, Peter R. Cheeke, 0-13-112586-9

Average number of hours required to be successful in this course:
For 16-week session: 5-6
For 8-week session: 8-10

Additional software or supplies: All work is completed in Moodle, however, we do use agednet.com as a resource.

In this course students can expect to complete or participate in the following activities: Discussion forums, quizzes, research papers, assignments.

Define academic progression in this course: Weekly assignments open up on Monday mornings at midnight. Students have until 11:59pm Sunday night to complete all assignments for the week. If a student goes 15 days without completing an assignment, they are dropped from the course.

Policy on make-up exams and/or late assignments: Work must be completed by midnight on Sunday night for the previous week. Late assignments are deducted 10 points for each day late with a 0 resulting after 10 days. Tests and quizzes are turned off at midnight on Sunday nights and not given late or as makeup quizzes except under extenuating circumstances.

Prerequisites- and Co-requisites: none

Required On-Campus Visits:  none

Additional information:  none


BIO 110

Principles of Biology

Required Textbooks: 

Biology Now. by Houtman, Scudellari, Malone, and Singh-Cundy. ISBN: 978-0-393-91892-2

Average number of hours required to be successful in this course:

For a 16-week session: 15-20 hours

Additional software or supplies:

Carolina Distance Learning Lab Kit #581638 – available to order at  http://www.carolina.com/catalog/detail.jsp?prodId=581638 (opens in a new window)
Reliable internet access Access to a browser that allows you to view Flash and Java- based pages and activities
Access to a digital camera and ability to upload your image files (jpg) for some assignments
Access to a printer to complete some assignments Microsoft Word or a program that can save files in Word-readable format (doc or docx)
Acrobat Reader or a way to view PDF files You may have to download software applications as needed for the course

In this course students can expect to complete or participate in the following activities: 

Moodle Lessons, Chapter Quizzes, Discussion Forums, Unit Exams, Online Lab Activities, Hands-on Lab Activities

Define academic progression in this course:

Students will be dropped from the course if they do not log into Moodle for 14 consecutive days. If students do not complete all assignments in a unit, they cannot move onto the next one.

Policy on make-up exams and/or late assignments: Late work is not accepted and no make-ups are allowed.

Prerequisites- and Co-requisites: RED-090 or ENG-095 or DRE-098

Required On-Campus Visits: None

Additional information: This course includes many hands-on lab activities that you will complete at home. Most materials will be provided in your lab kit, which costs about $90. For some labs, you will have to obtain additional materials (such as kitchen items, water, stopwatch, paper towels)


BUS 110

Introduction to Business

Required Textbooks: 

Foundations of Business 5th edition, by William Pride, Robert Hughes, Jack Kapoor ISBN: 9781337150088

Average number of hours required to be successful in this course:
For 16-week session: 3-5 hours
For 8-week session: 7-10 hours

Additional software or supplies:  Access Codes Required-Comes Bundled When Purchased From WCC Bookstore.  Students will use Microsoft Word or other word processing program to complete assignments.

In this course students can expect to complete or participate in the following activities:  Students will complete a variety of assignments using Mindtap/Cengage Website and module tests covering multiple chapters.

Define academic progression in this course: To be successful in the course students must be compliance with the attendance policy. The attendance policy in this course states that getting 3 chapters behind, the student will be dropped. Students must also allow time to read the chapters and complete the assignments and tests to be successful. To be considered successful, students must achieve an overall average of a “C”. Although a “D” is passing (in various curriculum programs), a “C” is needed to demonstrate competency.

Policy on make-up exams and/or late assignments: Assignments and tests must be completed and submitted by the due date. No exceptions!

Prerequisites- and Co-requisites: None

Required On-Campus Visits: None

Additional information: None

BUS 115

Business Law I

Required Textbooks: Business Law and the Legal Environment for Wayne Community College by Jeffrey F. Beatty, Susan S. Samuelson, and Dean A. Bredeson; ISBN#9781305779440

Average number of hours required to be successful in this course:
For 16-week session: 10-15 Hrs/week
For 8-week session: 15-20 Hrs/week

Additional software or supplies:  CengageNow for ALL of the assignments and tests for this class.

In this course students can expect to complete or participate in the following activities: Students will complete all assignments and tests using CengageNow

Define academic progression in this course: Students will be dropped if they miss 2 or more assignments.

Policy on make-up exams and/or late assignments: No make-up or late assignments are allowed.

Prerequisites- and Co-requisites: none

Required On-Campus Visits: none

Additional information: none

BUS 116

Business Law II

Required Textbooks: Business Law and the Legal Environment for Wayne Community College by Jeffrey F. Beatty, Susan S. Samuelson, and Dean A. Bredeson; ISBN#9781305779440

Average number of hours required to be successful in this course:
For 16-week session: 10-15 Hrs/week
For 8-week session: 15-20 Hrs/week

Additional software or supplies:  CengageNow for ALL of the assignments and tests for this class.

In this course students can expect to complete or participate in the following activities:

Define academic progression in this course: Students will be dropped if they miss 3 or more assignments in a row or 14 days in a row whichever occurs first.

Policy on make-up exams and/or late assignments: No make-up or late assignments are allowed.

Prerequisites- and Co-requisites: Prerequisite- Bus 115- Business Law I

Required On-Campus Visits: none

Additional information: none

BUS 137

Principles of Management

Required Textbooks: Effective Management, 7th edition, Chuck Williams

Average number of hours required to be successful in this course:
For 16-week session: 4-8 Hrs/week
For 8-week session: 8-16 Hrs/week

Additional software or supplies:  Access code with book for Cengage

In this course students can expect to complete or participate in the following activities: Quizzes, assignments, problem solving, tests

Define academic progression in this course: Students will be dropped if they miss 3 or more assignments or 14 days in a row, whichever occurs first.

Policy on make-up exams and/or late assignments: No make-up or late assignments are allowed.

Prerequisites- and Co-requisites: None

Required On-Campus Visits: None

Additional information: We discuss various topics in management revolving around planning, leading, organizing, and controlling. Along with the traditional learning methods, we will incorporate discussions on current topics in the business world accompanied by different learning techniques including debates, video presentations, and much more.

BUS 153

Human Resource Management

Required Textbooks: Managing Human Resources, 7th edition, by Snell, Morris, Bohlander, ISBN: 9781305778573

Average number of hours required to be successful in this course:
For 16-week session: 10-15 hours per week
For 8-week session: 15-20 hrs per week

Additional software or supplies: Access Codes Required – Textbook comes bundled when purchased from WCC Bookstore.

In this course students can expect to complete or participate in the following activities: Students will complete a variety of assignments using Mindtap/Cengage Website and module tests covering multiple chapters.

Define academic progression in this course: To be successful in the course students must be compliance with the attendance policy. The attendance policy in this course states that getting 3 chapters behind, the student will be dropped. Students must also allow time to read the chapters and complete the assignments and tests to be successful. To be considered successful, students must achieve an overall average of a “C”. Although a “D” is passing (in various curriculum programs), a “C” is needed to demonstrate competency.

Policy on make-up exams and/or late assignments: Assignments and tests must be completed and submitted by the due date. No exceptions!

Prerequisites- and Co-requisites: None

Required On-Campus Visits: None

Additional information: None

BUS 225

Business Finance

Required Textbooks: Fundamentals of Financial Management- ISBN: 9781285918419

Average number of hours required to be successful in this course:
For 16-week session: 3-5 hours per week
For 8-week session: 7-10 hours per week

Additional software or supplies: All assignments and tests are completed using CengageNow. An access code is required to gain access to the in CengageNow. Students need to make sure when purchasing the textbook that it comes bundled with an unused access code.

In this course students can expect to complete or participate in the following activities: Students will complete assignments for each chapter and module tests covering multiple chapters

Define academic progression in this course:To be successful in this course, students must remain in compliance with the attendance policy. The attendance policy in this course states that getting 3 chapters behind will result in the student being dropped from the course. Students must allow the recommended time to read the chapters, complete the chapter assignments and prepare and take the tests to be successful. To be considered successful, students must achieve an overall average of a “C”. Although a “D” is passing (in various programs), a “C” is needed to demonstrate competency.

Policy on make-up exams and/or late assignments: Assignments and tests must be submitted by the due date. No exceptions

Prerequisites- and Co-requisites: ACC 120

Required On-Campus Visits: No required visits to campus.

Additional Information: Instructor provides audio/video lectures demonstrating the various concepts covered in the course.

BUS 239

Business Applications Seminar

Required Textbooks: No Textbook For This Course

Average number of hours required to be successful in this course:
For 16-week session: 3-5 hours per week
For 8-week session: 7-10 hours per week

Additional software or supplies:  All assignments are submitted through Moodle. Students will submit assignments using Microsoft Word (or another word processing program) and Microsoft Excel (or another spreadsheet program).

In this course students can expect to complete or participate in the following activities: Students will complete essay writing assignments, group project, graduate portfolio project, CRC Test, and video assignments.

Define academic progression in this course:To be successful in this course, students must remain in compliance with the attendance policy. The attendance policy in this course states that getting 3 chapters behind will result in the student being dropped from the course. Students must allow the recommended time to read the chapters, complete the chapter assignments and prepare and take the tests to be successful. To be considered successful, students must achieve an overall average of a “C”. Although a “D” is passing, a “C” is needed to demonstrate competency.

Policy on make-up exams and/or late assignments: Assignments and tests must be submitted by the due date. No exceptions.

Prerequisites- and Co-requisites:  ACC 120, BUS 115, BUS 137, MKT 120, ECO 151 or 251 or 252

Required On-Campus Visits: No required visits to campus.

Additional information:  Because of the nature of the course and that some assignments require planning ahead and scheduling it is recommended that students become familiar with all requirements early on in the course. This is a capstone course that students take during their graduating semester.

BUS 240

Business Ethics

Required Textbooks: BUS 240 – ISBN: 9781305240988

Average number of hours required to be successful in this course:
For 16-week session: 10 hrs/week
For 8-week session: 15 hrs/week

Additional software or supplies: CengageNow is used for this class and it is mandatory that you purchase access for this site

In this course students can expect to complete or participate in the following activities: Multiple choice/case study assignments and an exam

Define academic progression in this course: Students will be dropped if they miss 2 or more assignments

Policy on make-up exams and/or late assignments: Assignments and tests must be completed and submitted by the due date. No exceptions!

Prerequisites- and Co-requisites: None

Required On-Campus Visits: None

Additional information: There is a Business Administration Lab for students that need some additional assistance. The lab hours are listed on the syllabus and in the Moodle course.

BUS 260

Business Communications

Required Textbooks: Essentials of Business Communication 10th edition

Average number of hours required to be successful in this course:
For 16-week session: 10 hours/week
For 8-week session:15 hours/week

Additional software or supplies: None

In this course students can expect to complete or participate in the following activities: Discussion forums, quizzes, and an exam

Define academic progression in this course: Students will be dropped if they miss 2 or more assignments

Policy on make-up exams and/or late assignments: Assignments and tests must be completed and submitted by the due date. No exceptions!

Prerequisites- and Co-requisites:none

Required On-Campus Visits: none

Additional information: There is a Business Administration Lab for students that need some additional assistance. The lab hours are listed on the syllabus and in the Moodle course.


CIS 110 – Introduction to Computers

Required Textbooks: Preparation for MOS Certification: Word & PowerPoint 2013; Vermaat and Sebok; ISBN #: 9781305771550

Average number of hours required to be successful in this course:

16-week course: 5-6 hours/week

8-week course: 10-12 hours/week

Additional software or supplies: The textbook bundle comes with the textbook, SAM access code, and Microsoft Office 2013. All are required for this course.

In this course students can expect to complete or participate in the following activities:  This class is very hands-on and software-driven. Students will be completing 5 chapters of Word, 4 chapters of PowerPoint, 2 chapters of Excel, and computer literacy skills.

Define academic progression in this course: Students typically have 1 week per chapter to submit assignments. If a student does not complete assignments for 14 consecutive days, they will be dropped from the course.

Policy on make-up exams and/or late assignments: No late work is accepted and no make-ups will be assigned per department policy and the course syllabus.

Prerequisites- and Co-requisites: CIS 070 or appropriate score on computer skills test

Required On-Campus Visits: None required; IST instructors host a computer lab for Microsoft Office students on Fridays from 9-11. Any student taking CIS 110 is welcome to come to this lab for assistance as needed (online or hybrid students).

Additional information: Students will have an opportunity to take 2 industry-recognized certifications; Word 2013 and PowerPoint 2013. These certifications are used by managers across the board in many fields as a factor in hiring and promoting.


 ENG 111

Writing and Inquiry

Required Textbooks: VanderMey, Randall, et al. The College Writer: A Guide to Thinking, Writing, and Researching. 5th ed. Stamford: Cengage, 2015. ISBN-13:  978-1285438016.

Average number of hours required to be successful in this course:
For 16-week session: 3-8 hours/week
For 8-week session:

Additional software or supplies: Extremely reliable computer equipment and internet service.  At least two other options for reliable computer equipment and internet service should your “usual” sources not be available; deadlines must be met, and problems with computer and internet technology will NOT be a valid reason for missing deadlines.  WCC library card to access online research and videos and a good college dictionary

In this course students can expect to complete or participate in the following activities: readings, papers, process assignments, drafts, reading responses, forums, outlines, and quizzes

Define academic progression in this course: Students are expected to complete all work assigned and participate meaningfully in any online discussion forums. Since this is an online course – not a face-to-face course – students who miss submitting two or more assignments in a row, are at risk for being withdrawn.

Policy on make-up exams and/or late assignments: Make-up of tests and assignments: Work will not be accepted after a deadline unless a student has received instructor-approval to turn in work late; that approval must have been given at least 24 hours before a deadline. If no such approval has been requested or granted, students should send whatever work has been completed on an assignment by the deadline to demonstrate that progress has been made on that assignment. It will then be up to the instructor as to whether the incomplete work receives any points, or if the student may be allowed to complete more work on the assignment in the future in an effort to receive more points.

Prerequisites- and Co-requisites: DRE 098 or other program multiple measure requirements

Required On-Campus Visits: none

Additional information: n/a

ENG 112

Writing/Research in the Disciplines

Required Textbooks: VanderMey, Randall, et al. The College Writer: A Guide to Thinking, Writing, and Researching. 5th ed. Stamford: Cengage, 2015. ISBN-13:  978-1285438016.

Average number of hours required to be successful in this course:
For 16-week session: 3-8 hours/week
For 8-week session: n/a

Additional software or supplies: Extremely reliable computer equipment and internet service,  At least two other options for reliable computer equipment and internet service should your “usual” sources not be available; deadlines must be met, and problems with computer and internet technology will NOT be a valid reason for missing deadlines, WCC library card to access online research and videos,  A good college dictionary

In this course students can expect to complete or participate in the following activities:  readings, writing (papers, outlines, writing mechanics
Define academic progression in this course: Students are expected to complete all work assigned and participate meaningfully in any online discussion forums. Since this is an online course – not a face-to-face course – students who miss submitting two or more assignments in a row, are at risk for being withdrawn.

Policy on make-up exams and/or late assignments: Work will not be accepted after a deadline unless a student has received instructor-approval to turn in work late; that approval must have been given at least 24 hours before a deadline. If no such approval has been requested or granted, students should send whatever work has been completed on an assignment by the deadline to demonstrate that progress has been made on that assignment. It will then be up to the instructor as to whether the incomplete work receives any points, or if the student may be allowed to complete more work on the assignment in the future in an effort to receive more points.

Prerequisites- and Co-requisites: Prerequisite: Eng 111 (C or better)

Required On-Campus Visits: none

Additional information: none


HIS 131

American History I

Required Textbooks: Ayers, Edward; Gould, Lewis; Oshinsky, David; Soderlund, Jean.  American Passages: A History of the United States. Advantage Books. 4th Edition. Boston: Wadsworth, 2010. ISBN – 13: 978-0-547-16646-9

Average number of hours required to be successful in this course:
For 16-week session: 3-8 hours/week
For 8-week session:

Additional software or supplies: none

In this course students can expect to complete or participate in the following activities: Discussion forums, individual writing assignments, tests and a final exam

Define academic progression in this course: If a student fails to complete 20% of assignments (quizzes, written and discussion forums – 4 assignments) by the scheduled deadlines, the student will be dropped from the class. Also, if a student does not log in for fourteen consecutive days, the student will be dropped.

Policy on make-up exams and/or late assignments: Students must pay careful attention to the deadlines for completing each assignment. Not completing an assignment results in a zero. Each day a written assignment/group project is late there will be a ten point reduction in the grade. Each day a discussion assignment is late there will be a five point deduction per late post.

Prerequisites- and Co-requisites: Prerequisite: RED 090, ENG 095, or DRE 098/ No Co-requisites

Required On-Campus Visits: none

Additional information:  none

HIS 132

American History II

Required Textbooks:  Ayers, Edward; Gould, Lewis; Oshinsky, David; Soderlund, Jean.  American Passages: A History of the United States. Advantage Books. 4th Edition. Boston: Wadsworth, 2010.
ISBN – 13: 978-0-547-16646-9

Average number of hours required to be successful in this course:

For 16-week session: 3-8 hours/week

For 8-week session:

Additional software or supplies: None

In this course students can expect to complete or participate in the following activities: discussion forums, papers, tests/quizzes

Define academic progression in this course:  If a student fails to complete 20% of assignments (quizzes, written and discussion forums – 4 assignments) by the scheduled deadlines, the student will be dropped from the class. Also, if a student does not log in for fourteen consecutive days, the student will be dropped.

Policy on make-up exams and/or late assignments: Students must pay careful attention to the deadlines for completing each assignment. Not completing an assignment results in a zero. Each day a written assignment is late there will be a ten point reduction in the grade. Each day a discussion assignment is late there will be a five point deduction per late post. Three posts are required per discussion.

Prerequisites- and Co-requisites: Prerequisites RED 090 or ENG 095 or DRE 098

Required On-Campus Visits: none

Additional information: none


HUM 110

Technology and Society

Required Textbooks: Thomas A. Easton,”Taking Sides: Clashing Views in Science, Technology, and Society” 10th ed., ISBN: 9780078050459

Average number of hours required to be successful in this course:
For 16-week session: 9 hours per week
For 8-week session: n/a

Additional software or supplies: n/a

In this course students can expect to complete or participate in the following activities: Discussion forums, journals, 3 tests, and one research paper.

Define academic progression in this course: Attendance is a vital part of this course. If a student fails to complete 20% of assignments (quizzes, written and discussion forums) by the scheduled deadlines, the student will be dropped from the class. Also, if a student does not log in for fourteen consecutive days, the student will be dropped.

Policy on make-up exams and/or late assignments: Late assignments will lose ten points for every 24 hours that they are late.

Prerequisites- and Co-requisites: RED 090 or ENG 095 or DRE 098

Required On-Campus Visits: None

Additional information:
The following ten-point grading scale will be used by this course:
90-100=A
80-89=B
70-79=C
60-69=D
Below 60=F


MAT 143

Quantitative Literacy

Required Textbook(s): Using & Understanding Mathematics A Quantitative Reasoning Approach, 6th edition by Bennett & Briggs and published by Pearson, ISBN: 978-0321914620

Average number of hours required to be successful in this course:

16-week session: 12 -16 hours per week

Additional software or supplies: TI-84 Graphing Calculator MyMathLab software access code (Included in the purchase of a new book, ordered online with the purchase of used book) Scanner or access to a scanner to submit work

In this course students can expect to complete or participate in the following activities: Discussion Forums, Labs, timed quizzes and test, unit projects

Define academic progression in this course: Student must log in each week and complete the assignments that are due for that week. Two consecutive weeks (14 days) of not doing work results in a drop from the course.

Policy on make-up exams and/or late assignments: NO LATE WORK ACCEPTED!!! NO MAKE UP TESTS/QUIZZES

Pre-requisites and co-requisites: none

Required On-Campus Visits: While no on-campus visits are required, if you do not have the necessary materials at home, you may need to use the open computer lab to be successful in the course.

Additional Information: PLEASE UNDERSTAND this is an ONLINE course, which requires dedication to understand the concepts, self-discipline to get the assignments complete, and organization to turn assignments in on time. Your grade in the course will truly reflect your work ethic throughout the semester.

MAT 171

Precalculus Algebra

Required Textbook(s): Precalculus plus MyMathLab with Pearson eText-Access Card Package, 5th edition, Robert Blitzer, ISBN-13 9780321900517

Average number of hours required to be successful in this course:

For 16-week session: 12-15 hours per week

For 8-week session: 20-30 hours per week

Additional software or supplies: You must be able to download and register for MyMathLab which comes with an access code you can get with a new text or can be purchased with a credit card through the publisher (Pearson). TI Graphing Calculator needed for this course.

In this course students can expect to complete or participate in the following activities: In this course, you will have to participate in discussion forums (1 per unit), MyMathLab quizzes, MyMathLab homework, and Tests in Moodle. I post weekly overviews, weekly checklists, lecture notes, videos, and other resources to help you be successful in this course.

Define academic progression in this course: Class attendance is essential if you plan to be successful; therefore, you must login weekly and complete the assignments that have been posted. If you have not participated during any two-week time frame (14 consecutive days), you will be dropped from the class. In addition, you can be dropped if you do not complete three nonconsecutive weeks of online assignments. You must complete the Enrollment Verification Quiz during the first 10% of the class to be considered enrolled in the course.

Policy on make-up exams and/or late assignments: I do not allow any make-up exams and I do not take any late assignments. You have one week to complete the work posted. One week time blocks are plenty of time to complete all the work required if you do not procrastinate.

Prerequisites and Co-requisites: Prerequisites: MAT 080 or MAT 070 and DMA 060 – 080 or MAT 060 and DMA 040 – 080 or DMA 010 – 080 or MAT 121 or Appropriate score on placement tests. Co-requisites: None Students taking MAT 171 must take MAT 172 for Precalculus credit.

Required On-Campus Visits: None

Additional Information: For additional help in the course; – visit Academic Skills Center or take advantage of their online tutoring – visit my office for help – email me and I will respond within 24 hours – watch videos that I have posted – find videos on YouTube relating to the topic – Khan Academy online – website that accompanies textbook…MyMathLab – Google It…find other online resources


MKT 120

Principles of Marketing

Required Textbooks: MKT 120 Pride/Ferrell – 7th Edition – Foundations of Marketing ISBN 9781337127783

Average number of hours required to be successful in this course:

For 16-week session: 10-15 hours per week

For 8-week session: 15-20 hours per week

Additional software or supplies: Access Codes Required-Comes Bundled When Purchased From WCC Bookstore. Students will use Microsoft Word or other word processing program to complete assignments.

In this course students can expect to complete or participate in the following activities: Students will complete a variety of assignments using Mindtap/Cengage Website and module tests covering multiple chapters.

Define academic progression in this course: To be successful in the course students must be compliance with the attendance policy. The attendance policy in this course states that getting 3 chapters behind, the student will be dropped. Students must also allow time to read the chapters and complete the assignments and tests to be successful. To be considered successful, students must achieve an overall average of a “C”. Although a “D” is passing (in various curriculum programs), a “C” is needed to demonstrate competency.

Policy on make-up exams and/or late assignments: Assignments and tests must be completed and submitted by the due date. No exceptions!

Prerequisites- and Co-requisites: None

Required On-Campus Visits: None

Additional information:  There is a Business Administration Lab for students that need some additional assistance. The lab hours are listed on the syllabus and in the Moodle course.


MKT 220

Advertising and Sales Promotion

Required Textbooks: You will NOT need to purchase a book for this course. YOU WILL NEED TO PURCHASE THE ACCESS CODE FROM THE BOOKSTORE. The ebook is located in MindTap (the website your purchased the access code for). You are required to register this access code for this class.

Average number of hours required to be successful in this course:

For 16-week session: 10-15 hours per week

For 8-week session: 15-20 hours per week

Additional software or supplies: Access Codes Required-Comes Bundled When Purchased From WCC Bookstore. Students will use Microsoft Word or other word processing program to complete assignments.

In this course students can expect to complete or participate in the following activities: Students will complete a variety of assignments using Mindtap/Cengage Website and module tests covering multiple chapters.

Define academic progression in this course: To be successful in the course students must be compliance with the attendance policy. The attendance policy in this course states that getting 3 chapters behind, the student will be dropped. Students must also allow time to read the chapters and complete the assignments and tests to be successful. To be considered successful, students must achieve an overall average of a “C”. Although a “D” is passing (in various curriculum programs), a “C” is needed to demonstrate competency.

Policy on make-up exams and/or late assignments: Assignments and tests must be completed and submitted by the due date. No exceptions!

Prerequisites- and Co-requisites: None

Required On-Campus Visits: None

Additional information: There is a Business Administration Lab for students that need some additional assistance. The lab hours are listed on the syllabus and in the Moodle course.

 

This is probably not the page you're looking for. You most likely want the 2015S website.

JavaScript (Fall 2014)

Intro to Front End Web Development

Course meets Tuesday 3:00pm – 4:30pm in Towne 319.

Instructor: Geoffrey Vedernikoff (veg@seas.upenn.edu)

TAs:

Office hours: See Piazza staff page

Course Description

This course provides an introduction to modern web development frameworks, techniques, and practices used to deliver robust client side applications on the web. The emphasis will be on developing JavaScript programs that run in the browser, not server-side applications in traditional languages like Java, Python, or Ruby. See the lecture schedule for more info.

This course is most useful for students who have some programming and web development experience and want to develop moderate JavaScript skills to be able to build complex, interactive applications in the browser.

Prerequisites

  • CIS 120 or equivalent (or permission of instructor).
  • Basic knowledge of HTML/CSS (if you don't meet this requirement, you are expected to pick up the basics on your own with online resources like Codecademy and Mozilla Developer Network).

Policies

Extensions on homework assignments will generally be granted if you ask for them in advance. Assignments come with the opportunity for revision up to a week after grading. See the course syllabus for more detailed policies and grading info.

Assignments

Assignments are due at 9am unless otherwise indicated. Code submissions are to be made using the Github submission system. Refer to the style guide for coding JavaScript.

hw0, due Tues, Sept. 9: Set up Github submission.

hw1, due Tues, Sept. 16: Finger exercises.

hw2, due Fri, Sept. 26: XML object modeling.

hw3, due Tues, Oct. 7: Pokémon map building.

hw4, due Tues, Oct. 21: Backbone.js starter.

hw5, due Fri, Oct. 31: Intermediate Backbone.js app.

hw6, due Wed, November 19: Autocompleter.

hw7, due Wed, December 3: Product Hunt Client and Final project proposal.

Final Project

The final project will be an open-ended JavaScript application created with client-side framework of the student's choice. It should demonstrate 10-15 hours of work. The due date is December 16.

See the proposal spec for more information.

Lectures

Code samples from lectures are available in this Github repository.

Reading

CIS197 Code Submission

CIS 197 (January 22, 2013)

Adapted from CIS 192.

Prerequisites

  • Mac or Linux environment. Windows works too, but some commands will be different and you are responsible for figuring out the differences.
  • Git installed in your development environment & some basic knowledge of git commands. If you need to boost your git skills, try Github help, Try Git, Git Immersion, and/or A Visual Git Reference.
  • A Github account. Feel free to use the one you have already.

Setup

Note: This system is still in beta. If you encounter errors in this guide or the course website, please post a private Piazza question. If you have a question about Git or Github, please post a public question.

  1. Complete the intro survey if you haven't already. Once you get an email saying you have been added to the cis197f14 organization, you may proceed with the next steps.

  2. Log onto Github. Change your view to the CIS 197 class context.

  3. Click on the repository we've created for your homework. The name will be in the format "hw_pennkey". Note this repository is private; only you and the instructors have access to it.

  4. Copy the repository url from its page.

  5. Open your terminal. You're going to clone a copy of this repository so that you can do work on it and push updates back to Github. First into the directory you want the homework folder in (if you don't know what that means, please take a few minutes to read Section 3 of this document. Now execute:

    put together, that all looks like

    You've now copied the (empty) repository onto our computer, so you can go into that directory:

  6. Now you're going to add the class homework repository as an "upstream" to our personal homework repository. This will allow you to pull required homework files directly from Github. You'll need to execute the following command inside the directory you just cloned:

    This added the class repository as a git "remote", which means that you can pull changes down from that repository and into your personal repository. Let's do that now. Run the command:

    and you should see that files were copied from the server.

  7. Almost done. You need to create a git branch where your code will be submitted. First, create a new branch called "submit":

    Now push that branch to Github:

    And also push the master branch to Github:

Great! Now that the setup is done, you can get started on homework.

Homework 0

The first submission is just to make sure you've set everything up correctly. It's a simple JavaScript Hello World program. For future homeworks, please refer to the next section.

  1. First, create a folder and create an empty file in it.

  2. Now, write the Hello World program into the file.

  3. Run the program to make sure it prints 'Hello world'.

  4. Now, you need to stage and commit all the relevant files:

    Push changes to Github:

  5. Follow steps 4 and 5 in the next section to submit the Pull Request and finish Homework 0.

Working on homework

  1. First, get any files/folders that were added to the class homework repository:

  2. Now complete your assignment. Please make sure to create a different folder in the repository for each homework assignment (, , etc.)

  3. Here's how you commit to the repository and push the work to Github. Let's say you wrote code in two files, and , in the directory inside your homework repository. First you need to stage all the relevant files:

    Now make a commit:

    Push changes to Github:

  4. Now your homework files are on Github. All you need to do now is create a pull request to complete the submission. Go to your homework repository and create a new Pull Request from the Pull Requests tab.

  5. Set up a pull request with the base branch set as "submit", and finally send it.

Do not click the "Merge Pull Request" button on Github after your submission (a TA will do that after grading homework). Though we require that you submit your homework with git, it would be wise to use git to keep track of your changes before you submit.

Notes

  • If you don't want to type your password every time you try to push or pull from Github, see the documentation on password caching.
  • Feel free to work on a branch other than (if you know what that means), but please make pull requests against the branch.

Lecture 1: Intro & JS Basics

CIS 197 (January 22, 2013)

Intro

As a browser scripting language, one of JavaScript's main uses is to implement view logic -- how a user interface on the web is drawn, manipulated, and interacted with. But as the language has matured, its scope has widened. Today, you can do things like build a web server in JavaScript using Node.js or compile video games from C++ to JS using Emscripten to play Quake III in a browser.

A few years ago, the traditional workflow of the front end developer was to get some JS (probably jQuery) code working locally, FTP it over to a server, and then handle the myriad cross-browser compatibility issues that ensued (*cough* IE6 *cough*). The past few years have seen somewhat of a transformation of the front end dev role, with a much greater emphasis on tools and practices. It's a result of:

  • people taking front end more seriously,
  • browsers getting MUCH better,
  • and more programmers with traditional programming experience entering the ecosystem

One of my goals in this class is to introduce you to modern tools, practices, and workflows in front end development. There's a sort of baseline of things that you're expected to be familiar with (Node, npm, homebrew, git, tests, build systems, etc.) in order to be successful and not feel left behind. I'll talk more about this at the end of today's lecture.

Today, I'm going to talk about language basics like syntax and variable scoping and there won't be much mention of the web. As a programming language, JS is an implementation of the ECMAScript standard, which makes no reference to web technology. We're currently on v5 of ECMAScript, with v6 expected to be a significant expansion to the language due in 2014.

Language Basics

See JS basics module.

Exercises

Using these basics, can you write out a Fizzbuzz program?

Solution:

Homework

Most of your homework will be to get up to speed with the tools you need for front end development.

The first important thing you're expected to know is git version control. Using version control allows you to collaborate on software projects and participate in the rich open-source community (JS is the most popular language on Github!) To boost your git skills, use online resources like:

For this class, I also expect a basic to moderate understanding of HTML/CSS. If you are lacking in this area, please use online resources like Codecademy and Mozilla Developer Network.

The rest of your homework is as follows:

  • Read the entiresyllabus.
  • Download Google Chrome (optionally, Chrome Canary).
  • Install the latest version of node.js (on OS X, I recommend using Homebrew).
  • Set up a Github account & fill out the intro survey.
  • Complete the code submisison tutorial.

JavaScript Basics

Reference: Eloquent JavaScript and JavaScript: The Good Parts.

← Back to Lecture 1

Introduction

JavaScript is a programming language being used to do all sorts of clever and horrible things on the web.

-- Marijn Haverbeke, EloquentJS

It's the world's most widely available application runtime. It runs in all modern web browsers and is one of the easiest languages to start using since you don't have to download anything. Even if you don't do much web programming, which this course focuses on, I hope I'll be able to expose you to some interesting (or even mind-boggling) programs that influence how you write good code in other languages and platforms. The good parts of JS (as Douglas Crockford points out) really make it a great functional language -- deep down, it actually shares more with Lisp and Scheme than C or Java (even though it looks like C or Java on the surface).

You might have heard a great deal of criticism about JS coming into the course (I'm sure I did when I first picked up JS). When you first start writing programs, you'll notice that it's very liberal in what it allows. However, what you type might end up being interpreted very differently from what you imagined. Consider this seemingly basic arithmetic with various types:

Sure, it might seem weird that we're adding together arrays, objects, and numbers (where other languages would throw type errors), but you somewhat get the idea.

This kind of weak dynamic typing accounts for much of the language's flexibility, but can also be troubling for beginners since the interpreter won't help you identify all errors. On the flip side, it allows for many techniques that are impossible in more strict languages. By learning the language properly and working with it for a while, I've grown to really like JS -- you might too!

Getting Started

We're going to learn JavaScript by reading, writing, and running code. Like I said, JavaScript usually runs in a browser, but it also runs on a platform called , which is built on Google Chrome's V8 JavaScript runtime. We'll talk more about Node later in the course, but for now I'll just use it as a JS interpreter and runtime to run code snippets.

You can fire up a REPL (interactive interpreter) simply with the command. If you don't have Node and want to follow along, you can use repl.it. (JS code can also be written to a file and run with ). Alternatively, you can simply open up the console in your web browser and type expressions:

Ready? Let's start by looking at the different kinds of values in JS.

Values

Number: only one type, written literally.

  • Internally, stored as a 64-bit double (like Java )
  • represents not a number, where a value did not produce a result
  • represents all numbers greater than (roughly)

String: written with single quotes or double quotes. Use single quotes.

  • Escape values with backslash
  • Insert Unicode character codes with
  • Can be compared with , (roughly alphabetical)
  • Strings are immutable, but easy to concatenate with

  • No type means you must use a single-char string

  • Each character is 16 bits wide
  • Access length with property (there are a few other String methods, discussed later)

Boolean: ,

  • Standard operators: , ,

A note about falsy values: The following values, when evaluated as Booleans, are false:

  • The empty string
  • The number
  • The number

All other values, including , the string , and all objects, are truthy. Control flows like this are common:

Object: curly braces (really convenient literal notation!)

  • Lightweight mutable key-value stores
  • Like C structs, Python dicts, associative arrays, etc.
  • Accessed with or refinement syntax

  • Under the hood, pretty much everything is represented as an object in JS (more on this later)

Array: square brackets literal notation.

  • Hash map performance
  • Internally represented as objects with numerical property names:
  • Convenience methods like , ,

Function: keyword + curly braces contain block of statements.

  • First-class JS object (this allows JavaScript to be highly functional)
  • "Piece of a program wrapped in a value"
  • Returns a value provided with keyword, otherwise

Undefined: void, null, un-assigned-to variables.

Values are garbage collected by the JS runtime (no , etc. like in C).

Let's examine some more language grammar & terminology...

Expressions

Expressions are anything that produces a value:

  • Literally written values (string, number, built-in)
  • Expression within parentheses
  • Unary operator applied to one expression (, , , ...)
  • Binary operator applied (infix) to two expressions (, , , , ...)
  • Ternary operator applied to three expressions ()
  • Object refinement (using or )
  • Invocation

Expressions cannot have side effects, meaning they cannot affect state of the program or the world. They only produce a value.

Statements

JavaScript programs are built as a list of statements. Each is typically terminated by a semicolon (C-style syntax). You can also sequence statements with but let's not have any of that in this course.

Programs are executed sequentially statement-by-statement from top to bottom; you can guarantee order of execution.

Programs

A JavaScript file contains a program. You can run multiple files at the same time and they will share a common global environment. There is no built-in module system in ECMAScript (coming soon in v6), but we will discuss later how you can properly organize your code to achieve the kinds of module or package systems you might be familiar with from other programming languages.

In a browser environment, each tag loads a compilation unit and executes the contained code immediately. Here we encounter one of the bad parts of JavaScript: reliance on global variables.

JavaScript lacks a linker (like ), so when it interprets a compilation unit, it throws all variables together into a common global namespace & scope.

Variable Scoping

We've seen a few variables in the above examples; let's look at them more closely. You declare variables simply with the keyword (look ma, no static types!).

Variables exist in an environment and can one of two scopes:

The rule for distinguishing the two is actually pretty simple: variables declared outside of a function definition are global while those inside are local.

Local variables are created and destroyed every time a function is run (which is often just once; we'll see how this is exploited).

Variables are evaluated as if they were declared at the top of the scope they exist in. This is referred to as hoisting. Take a look at this buggy program:

Why does line 5 print "undefined"?

Before JavaScript executes a function, it looks for all variable declarations within the current scope. It then declares all those variables but doesn't assign them (effectively executing the statement ). Only then does the function block get executed. Assignment of a variable occurs when the function execution reaches the line where you actually assign a variable.

In the example above, is re-declared as a local variable at the top of the function. So when we try to print out its value with , its value is undefined.

JavaScript Functions

Reference: Eloquent JavaScript and JavaScript: The Good Parts.


Generally, the craft of programming is the factoring of a set of requirements into a set of functions and data structures.

-- Douglas Crockford (JS: The Good Parts)

I won't too talk about the data structures, but let's examine the basics of what a function does in a programming language. Functions embody the logic of your application.

Pure functions have no side effects -- they don't affect the state of the world. They are easy to use and reason about since they require no context, and they are also more widely applicable to solving problems through code. However, they do not solve all the possible problems you might come across when developing software. I did say, of course, that JS is mainly used for view logic on the web; if we can't manipulate the state of a web page, then what good is our program?

This next bit of advice applies to nearly all programming languages: if a function seems simple enough that it can be written purely, then do so. In terms of programming language theory, JavaScript borrows a lot from functional languages, so it would be wise (and more natural to the language) to remain thinking functionally, trying to keep as much of the impure application logic contained to a few modules.

One more thing: like I said earlier, nearly everything in JS is an object, and that includes functions as well. They have a few special things about them, including invocation capabilities. We'll cover more of the nuances of the function object later.

Invocation

In addition to its arguments (which are immediately defined as variables), a function receives two extra special variables in its context: and .

refers to the containing scope or context of a function invocation:

Method Invocation: when invoked as a property of an object, a function's containing object is its context.

Function Invocation: functions not invoked as an object property are attached to the global object; this is somewhat of a flaw in JavaScript's design. This flaw is best demonstrated by example.

Let's say I wanted to augment with a method which doubles the contained property. And maybe I'd like to use a helper function to encode this logic, like so:

But this doesn't work! has not been doubled; function invocation is the reason why. Even though the function is being defined within a method of , it gets executed in the global context. As a result, within references the global context (where the property is meaningless).

The solution ends up being a strange construction like the following. Functions don't retain a reference to their parent , so we must manually keep a reference, usually called :

Constructor Invocation: when a function invocation is proceeded by the keyword, a new object is created and the function's scope is bound to that new object. This is strongly tied to prototypical inheritance, which is covered in the notes on objects.

Apply Invocation: because they're just objects, functions can have their own methods as well (crazy, I know). One in particular that's useful is the method, which allows you to specify a context and list.

Related: Call Invocation: works almost the same as the method, but instead of using an array, you pass arguments directly:

Closures

Because of the limited types of variable scoping available in JS, hiding private variables might seem difficult at first. But as as is often the case in the language, the incredible flexibility of functions comes to the rescue.

A closure in JavaScript is a function that, when invoked, is able to use variables not available in the current scope -- they were stored in the closure by the function that generated it. Here's a simple example.

Here, the global environment doesn't have access to the variable, but the function returned from is still able to access it. You'll see this immediately in any code intended for execution in Node: it will be wrapped in an Immediately-Invoked Function Expression (IIFE).

IIFE

We know by now that global variables in JavaScript are a Bad Thing. Luckily, JS programmers have developed a pattern to mitigate this concern. An immediately-invoked function expression is an anonymous function used at the top level of a JS program to provide a lexical scope for just that file / module. It looks like this:

What we've done here is define an anonymous function and immediately invoked it so that the contained code is run immediately when the file is loaded. The use of a function makes any an all declarations scoped to the anonymous function, not the global context.

Note the exports exposed by this module at the end of the IIFE. This is an instance of a closure!. When another file (or the Node interpreter) imports this module, it can use any properties or functions from the object, but it can't access the rest of the variables in the IIFE scope. Specifically, this example uses AMD (asynchronous module definition) syntax, which is the standard in Node.js.

Code Style

Code style is extremely important when developing code that you hope to last longer than its first writing. This is especially important with JavaScript because the interpreter is very tolerant and will allow a great deal of syntactic mistakes to pass undetected when code is executed. JS developers must exhibit great discipline in writing idiomatic code that is easily readable to all other developers.

Because of this, we're going to be adhering to a style guide for code written in this class. If you ever go out and write JavaScript professionally, you would do well to adhere to a structured style guide as well.

Indentation: use spaces, not tabs. 2 or 4 spaces.

Line Length: avoid lines longer than 80 characters.

Comments: be generous with comments, but try to describe more about why a function exists and the assumptions it makes rather than how it does things. JavaScript is an expressive enough language (with first class functions, etc.) that you can write very readable code that expresses intent properly.

Whitespace: most tokens should be separated by whitespace. Declare functions like this:

blocks and / loops should always be split into lines, as per the K&R standard:

Functions

If you use an identifier with a function expression, it provides the added benefit of showing up with a proper identifier in stack traces.

Alternatively, you can use a function definition syntax like the following example, but keep in mind that scoping works slightly differently – this function becomes available at the top of its scope while the above function expression syntax means that a function is only available when its expression is evaluated (and stored to that variable).

Operators

Avoid doing assignments in the conditional of and statements:

...looks like a statement where intent can easily be misinterpreted as

is evil and misused. Don't use it in your programs. It has aliases, so avoid those as well. Don't use the constructor or pass strings to / .

Similarly, should not be used.


Finally, you should be including an IIFE in all your JavaScript files (to avoid polluting the global namespace), along with a statement, which invokes stricter interpretation of your JS source (here's a more detailed explanation).

For a very detailed style guide, refer to idiomatic.js. (I generally agree with most of the conventions used there).

JavaScript Objects & Classes

Reference: Eloquent JavaScript and JavaScript: The Good Parts.


Prototypical Inheritance

All objects are linked to their prototype, an object from which they can inherit properties. Those created as object literals are linked to (built into the language).

When you attempt to retrieve an object property, JS will walk up the prototype chain until it finds a matching property name (known as delegation).

Prototypes are dynamic: changing or adding a property on one will make it immediately available to all objects that are linked to it.

  • The Array methods you access when dealing with arrays (like , , ) are stored in the global rather than every instance of an Array.
  • You can do some powerful things by updating a built-in prototype...

(Note: in hindsight, there's actually a built-in method called already. So you wouldn't want to overwrite it like this.)

  • And also some dangerous things! Let's say we wanted to swap the names of and , which remove an element from the tail and head of an Array, respectively:

    With this last bit of code, if you loaded anyone else's JS code (like the jQuery library, etc.), any code that relies on or wouldn't work properly. Lesson: be careful with global prototypes.

Keep in mind: The delegation of properties sometimes creates problems when you are only concerned with the immediate object in question (for reflection or enumeration). In this case, it's helpful to use the function available to all objects:

There's actually another way to solve this problem by being more specific about what type of property you are defining. The method lets you set a property on an object and configure it with a few parameters, including whether the property is enumerable, writable, etc. See its documentation.

Note: you are not guaranteed the order of properties with a loop on objects. If you are really concerned with enumerating the properties in order, it's best to list them out manually in an array:

Pseudo-classes

JavaScript is slightly conflicted about the nature of its inheritance, so its constructor syntax makes it seem somewhat classical. You will see many objects created with the keyword:

The keyword essentially tells the runtime to invoke the method from a function's prototype.

Before we further inspect how constructors work, let's consider what happens in the JS runtime when a function is created (they're objects too, after all).

When a function object is created, the internal constructor that produces the function object runs some code like this:

This behavior seems somewhat strange. Why do we need regular ol' functions to have constructors associated with them? Only those functions that actually construct class-like objects should behave like this, right? Here we encounter one of the flaws in the way JS does inheritance. JavaScript doesn't discriminate whether functions are meant to be constructors. This means that you as a programmer ought to demarcate constructors yourself through naming conventions (capitalize the first letter of the function name).

When JS runs a line of code invoking the keyword, some additional code gets run after . Note that represents the constructor function being invoked):

The method (see documentation) simply creates a new empty object with its set to a provided value. Then the constructor function is applied to the new object with proper arguments forwarded. If the constructor returned a value, that value is returned as the newly constructed object. Otherwise, the new object from is returned.

Knowing this, we can write some pseudoclassical code like this:

The object now looks something like a class definition:

A object would behave like so:

And let's say we wanted to inherit from this "class":

A couple things to note:

  • The constructor has to re-do the work of the constructor. Can you think of a way we can reuse the logic in with some clever function application?
  • I didn't set . This would have allowed access to the methods, but it would have also made it a two-way relationship, where any methods added to are also available to all instances, which we don't want. By instantiating a new object, we get the benefits of its prototype while maintaining separation.

We seem to be getting somewhere now! This behavior looks kinda object-oriented, doesn't it? But there are some wonky things going on.

  • The inheritance and "class" definition syntax looks weird because of the use of everywhere.
  • All properties are public.
  • You can't access the method.

Also, as I indicated above, there is some danger in defining a constructor like this. What would happen if you forgot the keyword when trying to use a constructor? (hint: how are functions regularly invoked?)

Again, this design flaw in JavaScript is mitigated by capitalizing the first letter of constructor functions. The hope is that a programmer reading the code can easily identify missing keywords.

As for the flaws mentioned above:

  • There are limited alternatives for object-oriented programming that do not use the syntax like this. Compile-to-JS languages (which we may cover later in the course) provide some great syntactic sugar that abstracts away this kind of low-level class definition.
  • Use closures in your JS modules to maintain private variables.
  • If you set up the classes right, you can use something like to access "super" methods.

Object.create

In ES5 (the current JS standard), there was a new method introduced called , which provides some simple syntax for differential inheritance. Its first argument is the prototype of the object you want to inherit from (or ), and the second (optional) argument is map of properties you want to set on the new object.

Another way to express the above class using :

This accomplishes the earlier goal of separating and 's prototype (there's a level of indirection since produces a new object) while also invoking the constructor.

Both this and the above method (in the section "Pseudo-classes") for object-oriented programming in JavaScript are acceptable. The method slightly reduces the number of lookups on the prototype chain when invoking "class" methods.


Here's a real world example of inheritance from the source code for the CIS 197 website. Note that the actual code in the repository is compiled from Coffeescript, not hand-written (but you'll notice the compiler produces very readable code!).

JavaScript in the browser

Reference: Eloquent JavaScript & Mozilla Developer Network.


The browser is a really hostile programming environment.

-- Douglas Crockford, The JavaScript Programming Language (video lecture)

The web browser is actually a great place that's experienced a huge deal of development in the past few years (again, this is correlated with an influx of front end dev tooling). But this quote does have a nugget of truth to it, as you'll experience yourself in writing JS for the browser.

The reason that web APIs and browsers have been able to advance quickly is that their development has been relatively decentralized. There is a standardizing body, but there is no central authority developing browsers and implementing language features. Various browser vendors (Google, Mozilla, Microsoft, etc.) have implemented features at different rates and this has made cross-browser support somewhat haphazard.

What is a browser?

A web browser has two main components that allow you to view and interact with web pages:

  • JavaScript engine: loads & interprets JavaScript source code in a sandboxed runtime. Can also implement extensions to the language.
  • Rendering engine (or layout engine, or simply browser engine): formats information on the page after parsing HTML & CSS.

Here are the major JS engines and rendering engines, respectively:

  • v8 + Blink (Google Chrome)
  • SpiderMonkey / Rhino + Gecko (Mozilla Firefox)
  • Nitro + WebKit (Apple Safari)
  • Chakra + Trident (Internet Explorer)

There are even sometimes differences in the core JavaScript runtime across browsers. For example, IE's runtime is known to have a memory leak when a circular reference is retained between a user-created object and a built-in object (such as a DOM reference).

Most of the development in these engines has been concerning performance. Mozilla, generally the leader in cutting-edge JS research, has released JS engines fast enough to run 3D games like Quake at 60fps in the browser.

A bit of syntax

Before going further, let's recall what a basic HTML document looks like:

In my examples, I'll usually eschew the , , , etc. tags and write a simplified version of the page.

Loading JavaScript in the browser

Well, we're not quite at the level of developing browser games right now. Let's first understand how JS is loaded in the browser environment.

Web browser programs differ fundamentally from most other programs you are used to writing in some key ways that have nothing to do with the JavaScript language. First off, think about what you're actually doing when you download JavaScript from the Internet to your web browser and executing it -- you're trusting source code from a huge number of websites of varying degrees of well-meaning to run on your computer. Sounds dangerous, doesn't it?

But we all get off just fine on the web, don't we? This is largely due to a neat little concept called sandboxing. Browsers severely limit the scope of capabilities that a JavaScript program can act on. It can't look at the files on your computer, modify things outside of the web page it's embedded in, or contact servers other than the one which served its web page.


Just like in a Node.js runtime, JS is executed in a global context, except this time it's called . It represents the current session in your browser tab, which is cleared with every page refresh. That means your browser requests new JS files and starts up a new global context when you switch or reload pages.

There are a few ways to invoke JS in an HTML page:

  • Inline tag

  • Linked tag

  • Attached as an event handler to a DOM element

The first two methods result in the JS code being parsed & run immediately as the browser engine encounters it (while parsing the HTML document), while the last (as indicated) runs some bit of JS code as an event callback.

Note: It's good practice to load your tags as late as possible in the HTML. This way, your browser displays a (possibly functioning) correctly-rendered HTML document with CSS before using precious CPU cycles on parsing and interpreting JavaScript code. Also, avoid inline script tags in favor of linked files. These files should be loaded at the end of :

There's no convenient way to load multiple scripts at once like this; you'll simply have to link all of them. But as we'll see later, various tools allow you to package your application into a single script, which is usually also good practice.

Document Object Model

Web pages structure is modeled using the Document Object Model, or DOM for short. We know that HTML is a heirarchical markup language, so it makes sense for our DOM to be a tree data structure.

Source: Eloquent JavaScript

In the above diagram we can see the two main kinds of DOM nodes: regular nodes and text nodes. Regular nodes are those with angle brackets in HTML markup and text nodes are simply inline strings (for example, the content of a tag.

The root of an HTML document is available as a global variable in the browser JS runtime called -- this is the starting point for locating any other node in the tree. There are a number of properties available on nodes; explore them in a browser console and/or the MDN DOM Reference.

So far what we've observed is an application programming interface for an HTML document. Our web browser did the work to parse the DOM and model it for us. Can we write a function that does the opposite (given a DOM node, print out its HTML and the HTML of its children)?

This is a neat little implementation, but it turns out there's a built-in function with pretty similar (and more robust) functionality. The property on DOM nodes returns a string of the HTML representation of a node (itself included). is the same, but it only looks at children of the node.

Homework 2: XML Document Modeling

Due Tuesday, September 23 at 9 AM.

Implementation stub available in the homework repository.

Before starting this assignment

Install the sax.js library by running in the root of your homework directory. Also, add the line "node_modules" to your file in this same folder (this prevents libraries from being committed to the git repository).

See this page to understand the relationship between XML and HTML.

Modeling XML documents

In this assignment you're going to develop an API for working with XML documents. Similar to how web browsers parse an HTML document (which is very similar to XML in structure anyway) and produce the Document Object Model for us to work with in JavaScript, the tool you produce will be able to take an XML document (as a string) as input and generate a JavaScript object that can inspect and filter the document tree.

First off, we ought to decide on a data structure to keep track of the XML nodes found during parsing. Since this is an exercise in object-oriented JS, we'll model XMLElements and the overall XMLDocument as objects.

TODO: Define a JavaScript class (using prototypes) called with the following properties and methods. The sample values show the expected representation for an XML node like .

These are not the only properties and methods allowed in the class; feel free to add more as necessary for your implementation. If you define properties or methods that you intend to be private (not part of the XML document object model), it's good practice to signify this with an underscore prefixed to the property / method name. For example, you might define a function on s that takes a hash and updates the stored attributes for a node.

However, the XMLElement constructor should take in a single config object (hash) that specifies its name and attributes. You should be able to call it like this:

TODO: Define a class called that simply wraps a text string in the XML tree. For example, the text inside would be an object with the properties:

The constructor for your XMLText object should take in value, like so:

Here's an example of what the children array in would look like:

TODO: Define another class called that inherits from . Ensure it has these additional properties / methods:

Generating the model

To actually do the string parsing of the XML Document, we're going to be using a library called . While understanding how a parser works is interesting on its own, I'll leave this topic for another course.

This parser reads in an XML document and provides callback hooks for events that occur during parsing. If you're not familiar with callbacks -- they are a method of asynchronous control flow that allows you to define a function to be run when an event occurs. Some resources for more information about callbacks:

Parser events we are interested in are the following:

  • : an error occurred in parsing; you should probably throw it.
  • : parsed an opening tag for a node, like
  • : parsed a closing tag for a node, like
  • : parsed some raw text within a node
  • : parsed a (name, value) pair for a node attribute

See the sax.js documentation for further reference. We don't care about CDATA for this assignment (even though it's in the XML standard).

Your implementation should decide what to do when each of these events occurs. In the end, a single should be produced that models the whole tree. You should be able to interact with the document object by invoking its tree filtering methods.

I have provided some implementation already in the class that starts off the parser. The tricky part is to now fill in the parser callback hooks in a way that builds a proper tree model. While parsing, it would behoove you to keep track (with a reference in the document builder class) of the current context of the parser, or where it is in the tree. You won't get this information in the parser callback; simply the relevant information that was just parsed.

In the end, you should be able to call the XMLDocumentBuilder like so:

Debugging

In the implementation stub, there are module exports set up for the file. We will be using the provided 3 attributes (XMLElement, XMLDocument, and XMLDocumentBuilder) to test your code, so you should not take them out. However, you are welcome to add more exports for testing. For example, if you set up a testing function called , your exports at the bottom of the file might look like:

To run the file and load these exports into a node interpreter, use the following commands (in the hw2 folder):

Also, if you're feeling adventurous, you could learn about the node debugger (related: node-inspector).

DOM Manipulation

DOM review

The object gives us ways of accessing and changing the DOM of the current web page.

General strategy for DOM manipulation:

  1. Find a DOM node using an access method and store it into a variable.
  2. Manipulate the DOM node by changing its attributes, styles, inner HTML, or appending new nodes to it.

Basic access methods: , HTML5 access methods: ,

Attributes are attached directly to the DOM element object; you can also use a getter / setter.

Styles are applied with the object property on nodes:

Changing content is possible with the property on nodes:

Creating nodes is possible with document methods:

These are the basics of working with the DOM. The rest of the lecture will build on these techniques and introduce browser events.


Chrome DevTools

Before we move on, though, we need to upgrade our toolkit for front end development. You all have a pretty powerful set of tools to inspect, debug, and profile web pages built into your browsers already – today I'll demonstrate the tools that ship in the Chrome browser (in-class demo).

All of this applies to Firefox, Safari, and IE as well (at least their modern versions), as they have similar built-in dev tooling.

For a web tutorial, refer to Google's DevTools docs.


So far in this course we've been programming in vanilla JavaScript; that is, we haven't really introduced any dependencies to our source code.

What is jQuery?

It's a JavaScript library. The most widely-used one ever. Here's why it's cool:

  • Optimized, abstracted DOM manipulation
  • Intuitive API and method syntax
  • Expressive selector syntax (driven by CSS selectors)
  • Bearable syntax for web requests

It'll make your life a whole lot easier.

Let's look at a few of the things jQuery is useful for.

Selecting elements

jQuery uses Sizzle, which is a CSS selector engine written in JavaScript. That means that you can select DOM elements in your JS source the same way you're selecting them to write CSS. Here are some examples:

You can see here that jQuery allows much more expressive and elegant selection functionality than that which is exposed by the DOM API. However, take caution – the Sizzle selector API hides some underlying performance assumptions you can make about your selection code. It's sort of a leaky abstraction, one which requires you to be knowledgeable about the lower-level functionality in order to write good, performant code.

If you take a look at how the style system matches rules and similarly, how Sizzle selectors are evaluated, you'll start to notice some pitfalls. Most of these apply to selectors in your CSS as well.

The key to writing fast jQuery selectors is understanding which native functions the library can leverage (most importantly, , , and ). Without these, jQuery must rely on a large DOM traversal loop that checks a large number of elements.

  • Don't qualify ID selectors. There's simply no advantage to doing this other than readability purposes (and if your ID isn't specific enough to be readable, consider revising that name).

  • Be careful with raw pseudo selectors. While pseudo selectors are very powerful, remember that they're not supported natively and if you don't limit your DOM search, it can be a slow lookup.

  • Class names are slow in IE. Keep in mind that all modern browsers except IE have built in, so it will be a slower lookup there. But then I suppose it's an issue of how much you care about your IE users...

To check the compatibility of DOM API methods like and (which tries to consolidate selection in the same fashion as Sizzle), refer to the compatibility table at the bottom of a Mozilla Developer Network DOM reference page for that method.

One more thing: keep in mind that when you select something with jQuery, it gets wrapped into a jQuery object instance containing all* the library's functionality. Think this has a greater runtime cost than using the DOM API? You bet it does! So you'll want to avoid recurring selectors:

... is better written as ...

In this example you also see an example jQuery's chaining syntax, which makes for a nice-to-use API.

* Well, not exactly all the functionality -- there are some global methods & constructors exposed on the jQuery object itself, like , etc.

Manipulating elements

Once you have your target element selected, what can you do with it? I won't go over all the methods available to jQuery object instances (see the docs for that), but it suffices to say that you have a lot of DOM manipulation power once you select an element with jQuery.

As we saw above, we can chain some of these methods:

This is possible because many jQuery methods return , a self-referential pointer to the jQuery object instance being manipulated.


"Things I Learned from the jQuery Source"

See the screencast here. Browser the source here.

Undefined

To ensure a valid keyword, jQuery and other libraries do something like this in their IIFE:

Animation

For animations: only works if there's an animation queue already there, so this doesn't work:

You can do one of the following instead:

Browser Support

is the result of a bunch of tests on the current DOM to notify you of browser bugs, unsupported things, etc. Also use similarly.

Stylish things

When you're trying to assign a variable, you can do sometimes elegantly affect some state as well:

Similarly, nested ternary operators let you be concise in assignment:

One last thing...

You'll see jQuery functions and plugins being defined on (and it might show up in stack traces). It's just a prototype object (but it doesn't correspond to the pseudo-classes we've been talking about).


Browser events →

References:

  • Eloquent JS
  • 10 Things I Learned from the jQuery Source (Paul Irish)
  • Pamela Fox's JS Teaching Materials

Browser Events

← DOM Manipulation

To build any application or web page that allows user interaction, you'll need to work with browser events.

If you recall the JS in browsers notes, we saw an event handler being attached to a "click" event on a DOM node:

"onclick" handlers like this are not advised (you should generally keep JS code only in JS files), so here's the API for it in plain JS:

(the last argument indicates whether the event should bubble up in the DOM tree as normal)

... so the above handler becomes:

Events types

Browsers can trigger many different events (see the full reference here). Here are some important ones:

  • Mouse: , , , , , , , ,
  • Touch: , , ,
  • Keyboard: , ,
  • Forms & their elements: , , ,
  • Window: , , , ,

Listeners are functions bound to events that get executed when a certain event occurs (also known as event handlers). They are passed a properties object relevant to and created by the event. For example, a reports mouse coordinates:

Event targets are also often available to handlers with ; for example, it's often useful to know which element on a page was clicked.

Note: since browser JavaScript is single-threaded, no two event handlers run at once. If an event occurs during the execution of a handler, it gets added to an event queue to be handled after the main thread is freed up.


Event propagation

Events bubble up the DOM tree in a phenomenon known as event propagation. Let's take the example of a block of text in a tag with links in it:

When you click on one of these links, the browser follows this chain of events:

  • Check if there are event handlers attached to those tags (could have been attached to just the one clicked, the anchor links in the relevant paragraph, or all anchor tags in the document)
  • Check if there are event handlers attached to the tag
  • Bubble the event up to any handlers
  • Finally execute the default handler, which follows a link to another web resource

If you want to prevent this kind of propagation up the document tree, you can use . also exists to let you specify when the built-in browser functionality for an event should be ignored.

Cross-browser compatibility

If you want your website to work across all browsers, there are a number of inconsistencies you're going to have to handle in your code. For example, IE8 and below use this alternative method for attaching a click handler:

... and it doesn't even support the third argument, .

We might try and be clever by creating a wrapper function like so:

Similarly, to detach events, you'd need something like this:

And while normally the object passed to a handler contains event properties, IE8 and below attach these properties to a global event variable, so you might see code like this:

For a detailed run down of these kinds of cross-browser incompatibilities, see Chapter 13 of Eloquent JS.

jQuery events to the rescue!

Much in the same way that jQuery abstracts DOM manipulation for us, it can also come to the rescue for dealing with events. Let's say we have a hover event handler function like this:

There are a few methods jQuery provides to bind handlers, including:

  • : the most straightforward, simply registers an event handler on each selected element in the jQuery object. Has related convenience methods like , , etc.

  • : same as , but attaches the handler to the document, which allows it to capture events for dynamically added elements that match the selector (deprecated as of jQuery 1.7)

  • : a more nuanced version of that lets you specify where to attach the handler:

  • is versatile and it allows you to emulate the above 3 methods; this is the most recommended:

This article, although slightly outdated, does a great job of explaining the differences in these approaches.

Document ready state

After your browser successfully receives a web page response from an HTTP request and parses its HTML, it has to do work to layout elements on the page from the HTML markup. There's a delay (on the order of milliseconds) between content appearing in your browser window and the DOM actually being ready. (Note: keep in mind that script execution can occur either before or after HTML layout, depending on where the tag is in the HTML markup).

Once a document is "ready", you can reliably interact with it in a script. is set to when this event occurs. Most logic in your JS applications should occur only after this event, so it's a common pattern you'll encounter.

Typically, you can listen for the event on the and run all your important DOM-interacting code within an event handler like this:

Unfortunately, this event isn't fired in all versions of IE. The event on the object is a pretty reliable callback:

But this doesn't capture all of the state of document ready. Using jQuery is usually your best bet for a reliable document ready state across all browsers as it handles most of the compatibility edge cases you might encounter. There is a convenient event binding method called

0 comments

Leave a Reply

Your email address will not be published. Required fields are marked *